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.

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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

xpresslibs-9.6.3-cp38-abi3-win_amd64.whl (48.6 MB view details)

Uploaded CPython 3.8+Windows x86-64

xpresslibs-9.6.3-cp38-abi3-manylinux2014_aarch64.whl (19.6 MB view details)

Uploaded CPython 3.8+

xpresslibs-9.6.3-cp38-abi3-manylinux1_x86_64.whl (60.0 MB view details)

Uploaded CPython 3.8+

xpresslibs-9.6.3-cp38-abi3-macosx_14_0_x86_64.whl (46.9 MB view details)

Uploaded CPython 3.8+macOS 14.0+ x86-64

xpresslibs-9.6.3-cp38-abi3-macosx_14_0_arm64.whl (14.2 MB view details)

Uploaded CPython 3.8+macOS 14.0+ ARM64

File details

Details for the file xpresslibs-9.6.3-cp38-abi3-win_amd64.whl.

File metadata

  • Download URL: xpresslibs-9.6.3-cp38-abi3-win_amd64.whl
  • Upload date:
  • Size: 48.6 MB
  • Tags: CPython 3.8+, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.11.15

File hashes

Hashes for xpresslibs-9.6.3-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 60a34168393a57da0d7df718d771c0ff00d88ba08accad4a32bc17161ba2331c
MD5 b5451b8ff10f28fd6cfbea55c578087c
BLAKE2b-256 6e8ef6f3e3636d054e5e48867906902ef933c95f1fd92583b5492b2bdf6ba94e

See more details on using hashes here.

File details

Details for the file xpresslibs-9.6.3-cp38-abi3-manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for xpresslibs-9.6.3-cp38-abi3-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 c4e562d128d3aa930c32ab75c95550eb02729bb82bfb3b3568bab4e2ebbe569d
MD5 35a6b545b86473f71cf45f26429be9ae
BLAKE2b-256 731b373e1d39310423c55c3730227526e78d6c8736acc41201f7ab30c87dcc16

See more details on using hashes here.

File details

Details for the file xpresslibs-9.6.3-cp38-abi3-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for xpresslibs-9.6.3-cp38-abi3-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 bce9f2181ac732bbf08e70f5fac4553e3b2824f81727c0a3fe0d12b4120816a7
MD5 312938e47811421311f0967b3b27b184
BLAKE2b-256 a2f951edfc6abfc059c1e94a2950ac36d17ec16a4cf1a48fdf221c3eef1c75e3

See more details on using hashes here.

File details

Details for the file xpresslibs-9.6.3-cp38-abi3-macosx_14_0_x86_64.whl.

File metadata

File hashes

Hashes for xpresslibs-9.6.3-cp38-abi3-macosx_14_0_x86_64.whl
Algorithm Hash digest
SHA256 0019d66e3125102e8c3bca057793904d50969428950b3b92a589d6a518dcbc69
MD5 a6276db0a642b818b43fc544f62e68ad
BLAKE2b-256 286a4c797af6d8997f9b90c6026c2f04e0e720b24dc8240878fe5373e841b2b3

See more details on using hashes here.

File details

Details for the file xpresslibs-9.6.3-cp38-abi3-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for xpresslibs-9.6.3-cp38-abi3-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 17915af986046f07a963973b0e80017be81f401b89c11ee300d6bdf36c32198a
MD5 c703eb203f317673ba4fe9b213a04e9a
BLAKE2b-256 32f4045395b49b03adc48d9053abae81d009c625ccf4fcbcdc7530001fe28c1f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page