Install Additional Python Packages

Install Python packages using OML and other methods.

Install Using OML

Use the installpythonpackage OML function to install a Python library directly from the Compose interface. You can add information to the existing installpythonpackage documentation as required.

Install Using Other Methods

Use the pip command to install packages from the repository.
  • Run the Python executable:
    Windows
    <INSTALLATION_ROOT>\common\python\python<version>\win64\python.exe -m pip install <package>
    Linux
    <INSTALLATION_ROOT>/altair/common/python/python<version>/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\python<version>\win64\python.exe -m pip install <path-to-wheel>/package_name.whl
    Linux
    <INSTALLATION_ROOT>/altair/common/python/python<version>/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.
  • 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.
      Windows
      set PYTHONUSERBASE=C:\\Users\\<userid>\\.altair\\Compose2023.1\\hwx\\python
      <INSTALLATION_ROOT>\common\python\python<version>\win64\python.exe -m pip install --user <package>
      Linux
      export PYTHONUSERBASE=/home/<userid>/.altair/Compose2023.1/hwx/python
      <INSTALLATION_ROOT>/altair/common/python/python<version>/linux64/bin/python3 -m pip install --user <package>