Installing Additional Python Packages
There are several ways to install additional Python packages.
Use the pip
command to install packages from the repository.
-
Run the Python executable:
- On Windows: <INSTALLATION_ROOT>\common\python\python3.5\win64\python.exe ‐m pip install <package>
- On Linux: <INSTALLATION_ROOT>/.altair/common/python/python3.5/linux64/bin/python3 ‐m pip install <package>
- For both Windows and Linux, you can also install a pre-compiled binary that's downloaded from other sources rather than installing from an online package, which could require compiling from the source. Resolving dependency issues on Windows can be complicated.
-
From the Python packages, download the wheel
package and use the following command to install it:
-
Windows
<INSTALLATION_ROOT>\common\python\python3.5\win64\python.exe ‐m pip install <path‐to‐wheel>/package_name.whl
-
Linux
<INSTALLATION_ROOT>/.altair/common/python/python3.5/linux64/bin/python3 ‐m pip install <path‐to‐wheel>/package_name.whl
Note: If a Python package requires any direct or indirect building of C++/Fortran code, it may not work. -
Windows
-
Install a Python package using the “--user”
option.
- Python packages installed using the “--user” option go to a default location if the PYTHONUSERBASE environment variable is not set. Python packages installed for other applications using “--user” will interfere with Compose if PYTHONUSERBASE is not set.
-
To avoid the potential problem, Compose sets
PYTHONUSERBASE to:
<user home directory>/.altair/Compose<version>/hwx/python.
- Set PYTHONUSERBASE to <user home directory>/.altair/ Compose<version>/hwx/python before using the argument “--user” to install packages.
Windowsset PYTHONUSERBASE=C:/Users/<userid>/.altair/Compose2019.3/hwx/python
<INSTALLATION_ROOT>\common\python\python3.5\win64\python.exe ‐m pip install --user <package>
Linuxexport PYTHONUSERBASE=/home/<userid>/.altair/Compose2019.3/hwx/python
<INSTALLATION_ROOT>/.altair/common/python/python3.5/linux64/bin/python3 ‐m pip install --user <package>