Initializing help system before first use

Installing the Python Xpress module

The Xpress Python module can be installed from the two main Python repositories: The Python Package Index (PyPI) and the Conda repository. Installing the Xpress Python interface does not require one to install the whole Xpress suite, as all necessary libraries are provided.

The install comes with a copy of the community license, which allows for solving problems with up to 5000 between variables and constraints. If you already have an Xpress license, please make sure to set the XPAUTH_PATH environment variable to the full path to the license file, xpauth.xpr. See also Section Troubleshooting the installation below.

The manual is located in the xpress/doc subdirectory of the Python installation folder, and its location can be identified by invoking the xpress.manual() function.

Installation from the Python Package Index (PyPI)

The Xpress Python interface is available on the PyPI server and can be installed with the following command:

pip install xpress

Packages for Python 2.7 and 3.5-3.8 are available, for Windows, Linux, and MacOS. The package contains the Python interface module, its documentation in PDF format, the Xpress Optimizer's libraries, various examples of use, and a copy of the community license (see http://subscribe.fico.com/xpress-optimization-community-license). Online documentation can be viewed at the FICO Xpress Optimization Help page.

Installation from Conda

A Conda package is available for download with the following command:

conda install -c fico-xpress xpress

The content of the Conda package is the same as that of the PyPI package. Similar to the PyPI package, Conda packages for Python 2.7 and 3.5-3.8 are available, for Windows, Linux, and MacOS.

Troubleshooting the installation

Whether the Xpress Python module is downloaded from PyPI or from the Conda server, there are a few remarks that might help ensure that the installation works right away. The advice below is independent of the Python platform (PyCharm, Spyder, etc.) that may be in use.

The Xpress Python interface uses the Python package NumPy for some operation, hence NumPy must be installed. It is usually installed if a Conda installation is used, nevertheless ensure that a recent-enough version is installed.

After installation, a license is not strictly necessary as the embedded Community license is used. If you already have a license (for example, a trial license, a full license, or one from the Academic Partnership Program), you can set the XPAUTH_PATH environment variable to the full path to the license file. For example, if the license file is /home/brian/xpauth.xpr, then XPAUTH_PATH should be set to /home/brian/xpauth.xpr in order for the module to pick the right license.

If you installed the Xpress Optimization suite before downloading the Xpress Conda or PyPI package, the Xpress Python interface will try to use the license file your Xpress installation automatically:

  • On Windows, the Xpress installer sets the XPRESSDIR environment variable to the installation directory, and the Xpress Python interface will look for a license file at %XPRESSDIR%\bin\xpauth.xpr.
  • On Linux and MacOS, the Xpress installer creates a script named xpvars.sh in the bin folder of the Xpress installation. This script sets XPRESSDIR to the installation directory, and sets XPAUTH_PATH to the location of the license file. If xpvars.sh has been properly sourced into the shell environment where Python is executed, the Xpress Python interface will use this XPAUTH_PATH value to locate the license from your Xpress installation. If for some reason XPAUTH_PATH is not set, the Xpress Python interface will look for a license file at $XPRESSDIR/bin/xpauth.xpr.

If you do not want to use the license file from your Xpress installation, you can override this behaviour by setting the XPAUTH_PATH environment variable to the full path to the license file that you want to use.