To install an external Python module to the package provided with Agisoft Metashape Professional it is necessary to perform the following single-line command from the command-line / terminal depending on the OS used and the name of the Python module to be installed:
on Windows
run cmd.exe with the administrator privileges:
"%programfiles%\Agisoft\Metashape Pro\python\python.exe" -m pip install python_module_name
on macOS
starting from version 10.15 Catalina (via Terminal):
/MetashapePro.app/Contents/Frameworks/Python.framework/Versions/3.9/bin/python3.9 -m pip install python_module_name
on Linux
via Terminal:
./metashape-pro/python/bin/python3.9 -m pip install python_module_name
python_module_name - you need to specify Python module name instead.
In case Linux installation doesn't work due to any reason (like ImportError: cannot import name 'HTTPSHandler') please install libssl 0.9.8 (as shown below) and repeat pip install process:
wget http://snapshot.debian.org/archive/debian/20110406T213352Z/pool/main/o/openssl098/libssl0.9.8_0.9.8o-7_amd64.deb sudo dpkg -i libssl0.9.8_0.9.8o-7_amd64.deb