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.7.2-cp38-abi3-win_amd64.whl (48.6 MB view details)

Uploaded CPython 3.8+Windows x86-64

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

Uploaded CPython 3.8+

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

Uploaded CPython 3.8+

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

Uploaded CPython 3.8+macOS 14.0+ x86-64

xpresslibs-9.7.2-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.7.2-cp38-abi3-win_amd64.whl.

File metadata

  • Download URL: xpresslibs-9.7.2-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.7.2-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 89580173a4b5bd8841d917732405a513684c2f2a37971453b316554e24a96fe2
MD5 0874b4152663a364749dc1dce0b14af3
BLAKE2b-256 6aed291d1ffb91e332353788416c0444f8fe8f8a23dd11ee325de6d7f3159291

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for xpresslibs-9.7.2-cp38-abi3-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 494cf9dbe3eb8cdad8466f2215583ad139947922d996ecdb6f14c549ab596bea
MD5 7aa83e46eb1a3f12769cce16fe8d43f3
BLAKE2b-256 36ea333e3f4c031da0a85681da758e05270e805a3377a0fe0114e6fe3363608b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for xpresslibs-9.7.2-cp38-abi3-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 5f8f30ad50278320606f14009deee72f897b358408bc263a5ebe1e88f64e419d
MD5 0bf8338348be854537c513d42c21df70
BLAKE2b-256 c321592a77dc4d920867b3bfdc398826e5811e4d391b9b3e14cabb8553f137d4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for xpresslibs-9.7.2-cp38-abi3-macosx_14_0_x86_64.whl
Algorithm Hash digest
SHA256 e2c3b4ffbd3516a09e147acf3b2bd3d3c4533378dbd140f3eb7b2b30bab14282
MD5 63b1b96207c9f05919ee00c61920a6be
BLAKE2b-256 150ef617bc2917ce2e90cbb8caf7b5c5f72ba6c546a0bd5b54884714bb8b32a7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for xpresslibs-9.7.2-cp38-abi3-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 f488a65fba26abbcf93d67802a6744706ace591f45d1e7362edc51c90215c942
MD5 5e528cb7f1b102af145e00438edf30ef
BLAKE2b-256 be529e1ca538c7c184d82963faac0c43b1c74c726e0714ea7f45131a305db909

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