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 XPRESS environment variable to the directory where the license file xpauth.xpr is located. 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.4-3.7 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.4-3.7 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 version 1.13 or later is installed for Python versions 2.7, 3.5, 3.6, and 3.7, and version 1.11 is installed for Python 3.4.
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), the XPRESS environment variable must be set, regardless of the platform, to the directory containing the license file. For example, if the license file is /home/brian/xpauth.xpr, then XPRESS must be set to /home/brian in order for the module to pick the right license. A message is printed upon import if XPRESS is not detected, in order to ensure that the user is using the right license file.
If you installed the Xpress Optimization suite before downloading the Conda or PyPI package with the Python interface, then the XPRESS variable is already set and no action is necessary.
© 2001-2019 Fair Isaac Corporation. All rights reserved. This documentation is the property of Fair Isaac Corporation (“FICO”). Receipt or possession of this documentation does not convey rights to disclose, reproduce, make derivative works, use, or allow others to use it except solely for internal evaluation purposes to determine whether to purchase a license to the software described in this documentation, or as otherwise set forth in a written software license agreement between you and FICO (or a FICO affiliate). Use of this documentation and the software described in it must conform strictly to the foregoing permitted uses, and no other use is permitted.