Installing Additional Python Packages

There are several ways to install additional Python packages.

Use the pip command to install packages from the repository.

  1. Run the Python executable:
    1. On Windows: <INSTALLATION_ROOT>\common\python\python3.5\win64\python.exe ‐m pip install <package>
    2. On Linux: <INSTALLATION_ROOT>/.altair/common/python/python3.5/linux64/bin/python3 ‐m pip install <package>
  2. 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.
  3. From the Python packages, download the wheel package and use the following command to install it:
    1. Windows
      <INSTALLATION_ROOT>\common\python\python3.5\win64\python.exe ‐m pip install <path‐to‐wheel>/package_name.whl
    2. 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.
  4. Install a Python package using the “--user” option.
    1. 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.
    2. To avoid the potential problem, Compose sets PYTHONUSERBASE to:
      <user home directory>/.altair/Compose<version>/hwx/python.
    3. Set PYTHONUSERBASE to <user home directory>/.altair/ Compose<version>/hwx/python before using the argument “--user” to install packages.
    Windows

    set PYTHONUSERBASE=C:/Users/<userid>/.altair/Compose2019.3/hwx/python

    <INSTALLATION_ROOT>\common\python\python3.5\win64\python.exe ‐m pip install --user <package>

    Linux

    export PYTHONUSERBASE=/home/<userid>/.altair/Compose2019.3/hwx/python

    <INSTALLATION_ROOT>/.altair/common/python/python3.5/linux64/bin/python3 ‐m pip install --user <package>