Skip to main content

FICO® Xpress Python interface

Create and solve Mathematical Optimization problems like the following:

min  x1^2 + 2 x2
s.t. x1 + 3 x2 >= 4
     -10 <= x1 <= 10
     x1 in Z
     x2 >= 0

with just a few lines of code:

import xpress as xp
p = xp.problem(name='myexample')  # problem name (optional)
x1 = p.addVariable(vartype=xp.integer, name='x1', lb=-10, ub=10)
x2 = p.addVariable(name='x2')
p.setObjective(x1**2 + 2*x2)      # objective function
p.addConstraint(x1 + 3*x2 >= 4)   # one or more constraints
p.optimize()
print ("solution: {0} = {1}; {2} = {3}".format (x1.name, p.getSolution(x1), x2.name, p.getSolution(x2)))

With the xpress module, one can create and solve optimization problems using the Python® programming language and the FICO Xpress Optimizer library. The module allows for

  • Creating, handling, solving, and querying optimization problems;
  • Using Python numerical libraries such as NumPy to create optimization problems;
  • Setting and getting the value of parameters (controls and attributes) of a problem; and
  • Using Python functions as callbacks for the Xpress Optimizer and the Xpress Nonlinear solver.

The Xpress Python interface allows for creating, handling, and solving all problems that can be solved with the FICO-Xpress library: Linear Programming (LP), Quadratic Programming (QP), Second-Order Conic Programming (SOCP), and their mixed-integer extensions: MILP, MIQP, MIQCQP, MISOCP, together with general nonlinear and mixed-integer nonlinear.

Installation

The Xpress Python interface can be downloaded from PyPI and from Anaconda. Run

pip install xpress

to install from PyPI, and

conda install -c fico-xpress xpress

to install from the Conda repository.

The downloaded package contains: a directory examples with several examples of usages of the module, with varying degrees of difficulty, and a directory license containing the Xpress Community License The full HTML documentation for the Xpress Optimizer, including the Python interface and its examples, is available at the FICO Xpress Optimization Help page.

If you do not have any FICO Xpress license, the community license will be recognized by the module and no further action is needed. If you do have a license, for instance located in /users/johndoe/xpauth.xpr, make sure to set the global environment variable XPRESS to point to the folder containing the xpauth.xpr file, i.e. XPRESS=/user/johndoe.

For a list of supported versions and their end of support dates, please see https://www.fico.com/en/product-support/support-level-software-release. Customers can download selected older versions of the package from the Xpress client area site by clicking on the Archived Downloads link.

GPU installation guidelines for PDHG

The primal-dual hybrid gradient (PDHG) linear optimization solver can now take advantage of an NVIDIA® CUDA®-capable GPU, if present. The GPU support for PDHG is available as a beta release with Xpress 9.8. The following platforms have been tested: Linux (both x86_64 and ARM64) and Windows (x86_64).

Software requirements:

  • At least version 580 of the NVIDIA drivers must be installed. The latest version is available from https://www.nvidia.com/drivers.
  • At least version 13.0 of the NVIDIA CUDA Runtime must be installed.

When installing Xpress from PyPI, the CUDA Runtime can be specified as an optional dependency:

pip install xpress[cuda]

When installing Xpress from Conda, the CUDA Runtime can be installed using the following command:

conda install -c nvidia cuda-cudart libcusparse libcublas

Alternatively, the CUDA Runtime can be installed as part of the CUDA Toolkit, which can be downloaded from https://developer.nvidia.com/cuda-downloads.

Licensing

The Xpress software is governed by the Xpress Shrinkwrap License Agreement. When downloading the package, you accept the license terms. A copy of the Xpress Shrinkwrap License is stored in the file LICENSE.txt in the dist-info directory of the Xpress module.

This package includes the community license of Xpress, see the licensing options overview for more details.

Miscellaneous

"Python" is a registered trademark of the Python Software Foundation. "FICO" is a registered trademark of Fair Isaac Corporation in the United States and may be a registered trademark of Fair Isaac Corporation in other countries. Other product and company names herein may be trademarks of their respective owners.

Copyright (C) Fair Isaac 1983-2026

Metadata

Release files for xpresslibs 9.8.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for xpresslibs 9.8.2
File
xpresslibs-9.8.2-cp38-abi3-win_amd64.whl CPython 3.8 abi3 Windows x86-64 Details
xpresslibs-9.8.2-cp38-abi3-manylinux2014_aarch64.whl CPython 3.8 abi3 Linux glibc 2.17+ ARM64 Details
xpresslibs-9.8.2-cp38-abi3-manylinux1_x86_64.whl CPython 3.8 abi3 Linux glibc 2.5+ x86-64 Details
xpresslibs-9.8.2-cp38-abi3-macosx_14_0_x86_64.whl CPython 3.8 abi3 macOS 14.0+ x86-64 Details
xpresslibs-9.8.2-cp38-abi3-macosx_14_0_arm64.whl CPython 3.8 abi3 macOS 14.0+ ARM64 Details

Total release size: 170.3 MB

Release files / xpresslibs-9.8.2-cp38-abi3-win_amd64.whl

Download URL xpresslibs-9.8.2-cp38-abi3-win_amd64.whl
Size 44.5 MB
Tags CPython 3.8 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
364585ea8d00380053348ba0e10024d89ef4a637dde8326ddb29872ee69acb70
BLAKE2b-256 checksum
How to use checksums
b08a9e4953b8b528febc7a71c364de7b0936eefd7f2c540a39a37a04910eae28
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.16

Release files / xpresslibs-9.8.2-cp38-abi3-manylinux2014_aarch64.whl

Download URL xpresslibs-9.8.2-cp38-abi3-manylinux2014_aarch64.whl
Size 18.0 MB
Tags CPython 3.8 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
6ab15057c53814ac83c05723aa68965681665a7dfe6e42db1c0ef26685a71567
BLAKE2b-256 checksum
How to use checksums
70e13cdf02d53198c9f6655871ec93de917ba6101b2d3022eeffa8f74f17d902
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.16

Release files / xpresslibs-9.8.2-cp38-abi3-manylinux1_x86_64.whl

Download URL xpresslibs-9.8.2-cp38-abi3-manylinux1_x86_64.whl
Size 46.8 MB
Tags CPython 3.8 Linux glibc 2.5+ x86-64 abi3
SHA-256 checksum
How to use checksums
b765830bd915269cb0407723bef51e9b2b73e7faecc80e50624f1c942742e923
BLAKE2b-256 checksum
How to use checksums
0e5fcd5880b44ced6031a793be62d317b97c63826bf41c8cbfd860c868328cf9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.16

Release files / xpresslibs-9.8.2-cp38-abi3-macosx_14_0_x86_64.whl

Download URL xpresslibs-9.8.2-cp38-abi3-macosx_14_0_x86_64.whl
Size 46.7 MB
Tags CPython 3.8 abi3 macOS 14.0+ x86-64
SHA-256 checksum
How to use checksums
b457ebce16f7a0be8e57bf90869871a442e109a2952ebd80a964ee7b491ecf6c
BLAKE2b-256 checksum
How to use checksums
dc9b9f10b6a793bdbe16806e94dd5507e4e83521f4d8a8bbe218bca57e323457
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.16

Release files / xpresslibs-9.8.2-cp38-abi3-macosx_14_0_arm64.whl

Download URL xpresslibs-9.8.2-cp38-abi3-macosx_14_0_arm64.whl
Size 14.2 MB
Tags CPython 3.8 abi3 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
669740df1b5a706f971d7f8513c276e889cdd612099a7f223e689522e31983e1
BLAKE2b-256 checksum
How to use checksums
3530b0b949806e1b121ae4fdb1cf77bad9c04a735ff41ac444833990583e474b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.16

Release history Release notifications | RSS feed

9.9.1

4 release files

9.9.0

4 release files

This release

9.8.2 This release

5 release files

9.8.1

5 release files

9.8.0

5 release files

9.7.2

5 release files

9.7.1

5 release files

9.7.0

5 release files

9.6.3

5 release files

9.6.2

5 release files

9.6.1

5 release files

9.6.0

7 release files

9.5.8

5 release files

9.5.7

5 release files

9.5.6

5 release files

9.5.5

5 release files

9.5.4

5 release files

9.5.3

5 release files

9.5.1

5 release files

9.5.0

5 release files

9.4.6

5 release files

9.4.5

5 release files

9.4.4

5 release files

9.4.3

5 release files

9.4.2

5 release files

9.4.1

5 release files

9.3.9

5 release files

9.3.8

5 release files

9.3.7

5 release files

9.3.6

5 release files

9.2.12

5 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page