FICO Xpress Optimizer Libraries
raw JSON → 9.8.1 verified Mon Apr 27 auth: no python
Python distribution of the FICO Xpress Optimizer solver libraries (version 9.8.1). Provides the core C libraries (XPRS DLLs/SOs) for mathematical optimization, typically accessed via the xpress Python package. Bundles the native solver binaries needed by the xpress interface.
pip install xpresslibs Common errors
error ModuleNotFoundError: No module named 'xpress' ↓
cause xpress Python package not installed; only xpresslibs is installed.
fix
Install the xpress package: pip install xpress
error xpress.initlicense(): License error: No license found ↓
cause Xpress license file not found or invalid.
fix
Ensure xpauth.xpr license file is in the current directory or set XPRESSDIR environment variable to the directory containing the license.
error ImportError: libxprs.so: cannot open shared object file: No such file or directory ↓
cause Native libraries not found. On Linux, the library path may not be set.
fix
Ensure xpresslibs is correctly installed. Try reinstalling: pip install --upgrade xpress xpresslibs. For manual path setting, use xpresslibs.add_to_ld_library_path() or set LD_LIBRARY_PATH.
error OSError: [WinError 193] %1 is not a valid Win32 application ↓
cause Attempting to load 64-bit library with a 32-bit Python interpreter.
fix
Use a 64-bit Python installation.
Warnings
breaking xpresslibs 9.8.1 includes the Xpress Optimization 9.8.1 solver libraries. Libraries are platform-specific (Windows, Linux, macOS) and require matching architecture (64-bit). Incompatible with older xpress Python package versions. ↓
fix Ensure xpresslibs version matches xpress package version (e.g., both 9.8.1).
gotcha xpresslibs does not install the xpress Python package; it only provides the native libraries. Installing xpresslibs alone will not make the solver usable. ↓
fix Install both: pip install xpress xpresslibs, or simply pip install xpress which automatically pulls xpresslibs.
deprecated Support for 32-bit architectures was dropped in Xpress 9.0. Older xpresslibs versions may still include 32-bit libraries, but 9.8.1 only ships 64-bit binaries. ↓
fix Use a 64-bit Python interpreter and operating system.
gotcha License activation required. The Xpress Optimizer is commercial software; a license file (xpauth.xpr) must be present. Without a valid license, the solver fails with an error. ↓
fix Set environment variable XPRESSDIR to the installation path or place license in the working directory. Obtain a license from FICO.
Imports
- XPRS wrong
import xpresslibscorrectimport xpress as xp - Library path (e.g., xpresslibs.get_lib_path())
import xpresslibs; print(xpresslibs.get_lib_path())
Quickstart
import xpress as xp
p = xp.problem()
x = p.addVariable(name='x')
y = p.addVariable(name='y')
p.setObjective(x + 2*y, sense=xp.minimize)
p.addConstraint(x + y >= 1)
p.optimize()
print("x =", p.getSolution(x))
print("y =", p.getSolution(y))