Skip to main content

The Python Interface to LINGO.

This package requires Lingo and a valid license key. Please refer to the Lingo user manual for installation instructions, and to learn more about the Lingo modeling language.

LINGO 23 Release

Package version 23.0.5 targets the LINGO 23.0.160 SDK and requires Python 3.9 or newer. The Windows build matrix covers Python 3.9 through 3.15. Linux builds use the matching LINGO 23 SDK archive and Python matrix configured in the Dockerfile. The Python package version is independent of the native LINGO SDK version.

On 64-bit Windows, set LINGO64_23_HOME to the LINGO 23 installation directory. On Linux, set LINGO_23_HOME to the LINGO 23 installation directory. Use window_build.bat for Windows builds and Dockerfile for Linux builds.

Windows build server

All Windows wheels are built and tested by window_build.bat on one machine. Linux wheels are built separately (see DOCKER_NOTES.md). The machine needs:

  • Visual Studio Build Tools 2022 with the C++ workload. setuptools finds it through vswhere, so cl does not need to be on PATH.
  • LINGO 23 installed and licensed, with LINGO64_23_HOME set to its directory.
  • 64-bit Python 3.9 through 3.15 from python.org, installed for all users and listed by py -0p. The script selects each one with py -V:3.x.

From the repository root:

window_build.bat              rem every Python in the matrix
window_build.bat 3.13 3.14    rem only these versions

For each version the script:

  1. builds the wheel in a fresh venv under %TEMP%;
  2. installs the wheel;
  3. runs python -m lingo_test, a MOSEK/TBB DLL check, tests\check_numpy.py and tests\test_regressions.py.

Wheels go to dist\. An earlier wheel of the same version for a Python being rebuilt is moved to dist\old-<timestamp>\, and wheels for other Pythons are left in place. The full log goes to WindowsBuildOutput_<version>.txt. The script stops at the first failure and exits 0 only when every version passed and one win_amd64 wheel exists for each.

No license

If LINGO finds no valid license, lingo_api.solve() raises lingo_api.LingoLicenseError (a subclass of LingoError) instead of returning 0. The error says where LINGO looked and includes LINGO's own instructions, such as running runlingo -d to create a demo license.

try:
    lingo_api.solve(model)
except lingo_api.LingoLicenseError as e:
    print(e)

With LINGO 23.0.167 or later the error code is 7 (LSERR_INVALID_LICENSE_KEY_LNG). Older LINGO libraries report success without a license. For those, solve() reads LINGO's error 171 from the log, so it can only detect a missing license when the Model has a logFile (the default is TempModel.log).

Installation For LINGO 21

This python package can be installed with pip. It is assumed Lingo 21 is installed on host system.

For administrative users:

> pip install lingo_api

For standard (non-administrative) users:

> pip install lingo_api --user

Installation For LINGO 20

This python package can be installed with pip. It is assumed Lingo 20 is installed on host system.

For administrative users:

> pip install lingo_api==20.0.9

For standard (non-administrative) users:

> pip install lingo_api==20.0.9 --user

Testing

A quick way to test the installation is to run

> python -m lingo_test

It is also good to test the LINGO API on one of the included examples.

> cd examples/Chess
> python chess.py

Possible errors due to misconfiguration

If the user does not have the correct LINGO environment variable set, they will not be able to load the lingo_api library instead they will receive an error message.

To fix the problem follow these steps

Using Windows

On the command line depending on the users LINGO installation:

LINGO 23 on windows 64-bit

> setx LINGO64_23_HOME "C:\path\to\LINGO64_23" 

LINGO 23 on windows 32-bit

> setx LINGO_23_HOME "C:\path\to\LINGO23" 

Using Linux

On the command line depending on the users LINGO installation:

LINGO 23 For standard (non-administrative) users:

$ export LINGO_23_HOME="$HOME/LINGO64_23"

For administrative users:

$ export LINGO_23_HOME="/opt/LINGO64_23"	

If a shared library cannot be loaded, add the LINGO library directory to the loader path:

$ export LD_LIBRARY_PATH="$LINGO_23_HOME/bin/linux64${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"

To have these variables set automatically, add the relevant lines to the ~/.bashrc or ~/.bash_profile file.

How to Build Wheel and Install (for package managers)

To build the python package on any operating system first start by creating a whl file. From the top of the lingoapi-python directory run the command.

> python -m build

If the command is successful a new directory named dist is created in the lingoapi-python directory. The new directory will have two files with extension .whl and .tar.gz. For example, if the LINGO API is built it on Windows using Python 3.10 the new directory will look like this.

├── dist
│  ├── lingo_api-x.y.z-cp310-cp310-win_amd64.whl
│  └── lingo-x.y.z.tar.gz

The package can now be installed locally using the command.

> pip install dist/*.whl

Metadata

Release files for lingo-api 23.0.5

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 lingo-api 23.0.5
File Actions
lingo_api-23.0.5-cp315-cp315-win_amd64.whl CPython 3.15 CPython 3.15 Windows x86-64 Details for lingo_api-23.0.5-cp315-cp315-win_amd64.whl
lingo_api-23.0.5-cp315-cp315-manylinux_2_31_x86_64.manylinux_2_34_x86_64.whl CPython 3.15 CPython 3.15 Linux glibc 2.34+ x86-64, Linux glibc 2.31+ x86-64 Details for lingo_api-23.0.5-cp315-cp315-manylinux_2_31_x86_64.manylinux_2_34_x86_64.whl
lingo_api-23.0.5-cp314-cp314-win_amd64.whl CPython 3.14 CPython 3.14 Windows x86-64 Details for lingo_api-23.0.5-cp314-cp314-win_amd64.whl
lingo_api-23.0.5-cp314-cp314-manylinux_2_31_x86_64.manylinux_2_34_x86_64.whl CPython 3.14 CPython 3.14 Linux glibc 2.31+ x86-64, Linux glibc 2.34+ x86-64 Details for lingo_api-23.0.5-cp314-cp314-manylinux_2_31_x86_64.manylinux_2_34_x86_64.whl
lingo_api-23.0.5-cp313-cp313-win_amd64.whl CPython 3.13 CPython 3.13 Windows x86-64 Details for lingo_api-23.0.5-cp313-cp313-win_amd64.whl
lingo_api-23.0.5-cp313-cp313-manylinux_2_31_x86_64.manylinux_2_34_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.31+ x86-64, Linux glibc 2.34+ x86-64 Details for lingo_api-23.0.5-cp313-cp313-manylinux_2_31_x86_64.manylinux_2_34_x86_64.whl
lingo_api-23.0.5-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details for lingo_api-23.0.5-cp312-cp312-win_amd64.whl
lingo_api-23.0.5-cp312-cp312-manylinux_2_31_x86_64.manylinux_2_34_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.31+ x86-64, Linux glibc 2.34+ x86-64 Details for lingo_api-23.0.5-cp312-cp312-manylinux_2_31_x86_64.manylinux_2_34_x86_64.whl
lingo_api-23.0.5-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details for lingo_api-23.0.5-cp311-cp311-win_amd64.whl
lingo_api-23.0.5-cp311-cp311-manylinux_2_31_x86_64.manylinux_2_34_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.34+ x86-64, Linux glibc 2.31+ x86-64 Details for lingo_api-23.0.5-cp311-cp311-manylinux_2_31_x86_64.manylinux_2_34_x86_64.whl
lingo_api-23.0.5-cp310-cp310-win_amd64.whl CPython 3.10 CPython 3.10 Windows x86-64 Details for lingo_api-23.0.5-cp310-cp310-win_amd64.whl
lingo_api-23.0.5-cp310-cp310-manylinux_2_31_x86_64.manylinux_2_34_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.31+ x86-64, Linux glibc 2.34+ x86-64 Details for lingo_api-23.0.5-cp310-cp310-manylinux_2_31_x86_64.manylinux_2_34_x86_64.whl
lingo_api-23.0.5-cp39-cp39-win_amd64.whl CPython 3.9 CPython 3.9 Windows x86-64 Details for lingo_api-23.0.5-cp39-cp39-win_amd64.whl
lingo_api-23.0.5-cp39-cp39-manylinux_2_31_x86_64.manylinux_2_34_x86_64.whl CPython 3.9 CPython 3.9 Linux glibc 2.34+ x86-64, Linux glibc 2.31+ x86-64 Details for lingo_api-23.0.5-cp39-cp39-manylinux_2_31_x86_64.manylinux_2_34_x86_64.whl

Total release size: 344.6 MB

Release files / lingo_api-23.0.5-cp315-cp315-win_amd64.whl

Download URL lingo_api-23.0.5-cp315-cp315-win_amd64.whl
Size 25.1 kB
Tags CPython 3.15 Windows x86-64
SHA-256 checksum
How to use checksums
8275f3764c892ea022b8010395e4af3c3c644ebac55dd7cbb55b68e5189b7570
BLAKE2b-256 checksum
How to use checksums
f93102f709fd2d536e1a364260a9e82bb855b827c04f7b4879d0dc43cf36b4e3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.10

Release files / lingo_api-23.0.5-cp315-cp315-manylinux_2_31_x86_64.manylinux_2_34_x86_64.whl

Download URL lingo_api-23.0.5-cp315-cp315-manylinux_2_31_x86_64.manylinux_2_34_x86_64.whl
Size 49.2 MB
Tags CPython 3.15 Linux glibc 2.31+ x86-64 Linux glibc 2.34+ x86-64
SHA-256 checksum
How to use checksums
c199f814356af38ef8cdb4fe83fcc2fb93335c383acf710e9b5959c0ebfc2df1
BLAKE2b-256 checksum
How to use checksums
b5399879c0384c781a11e29ee90d44ff7a12b1e0b399ca44e9d5003a151f901b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.5

Release files / lingo_api-23.0.5-cp314-cp314-win_amd64.whl

Download URL lingo_api-23.0.5-cp314-cp314-win_amd64.whl
Size 25.1 kB
Tags CPython 3.14 Windows x86-64
SHA-256 checksum
How to use checksums
c77aacb098514cb4446f7dce6a8448ef29478bcefea292dbbe2c7702e6f2d17a
BLAKE2b-256 checksum
How to use checksums
4d8e4cc84047b35582733aad7110d1c61d277a2952f579f1f6061c6a3d3d99d6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.10

Release files / lingo_api-23.0.5-cp314-cp314-manylinux_2_31_x86_64.manylinux_2_34_x86_64.whl

Download URL lingo_api-23.0.5-cp314-cp314-manylinux_2_31_x86_64.manylinux_2_34_x86_64.whl
Size 49.2 MB
Tags CPython 3.14 Linux glibc 2.31+ x86-64 Linux glibc 2.34+ x86-64
SHA-256 checksum
How to use checksums
f728edc89e4dead7e68af39df9bb63a7af012b45f41ab2bb984dad7a97801211
BLAKE2b-256 checksum
How to use checksums
754ee572ece0d9920991e66a28f1b6ba3787b4010968cace9cc193dd1c9109c2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.5

Release files / lingo_api-23.0.5-cp313-cp313-win_amd64.whl

Download URL lingo_api-23.0.5-cp313-cp313-win_amd64.whl
Size 24.8 kB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
8c7e19528fa8e5c8b8c0a1c86d56573e026a16151fc755b61514ae813e62f92b
BLAKE2b-256 checksum
How to use checksums
f8f7a499154047ea466df121ea8c952f5f8a0879f9198d5b509d73a12654e7ff
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.10

Release files / lingo_api-23.0.5-cp313-cp313-manylinux_2_31_x86_64.manylinux_2_34_x86_64.whl

Download URL lingo_api-23.0.5-cp313-cp313-manylinux_2_31_x86_64.manylinux_2_34_x86_64.whl
Size 49.2 MB
Tags CPython 3.13 Linux glibc 2.31+ x86-64 Linux glibc 2.34+ x86-64
SHA-256 checksum
How to use checksums
d3868d20f09e8c09dc0f36b6ca1b1a44a7d0b9a49de1c3d70613170ba0fda290
BLAKE2b-256 checksum
How to use checksums
72be6550ee5344416e4616007f93b8a9f48e00d1cfdf7226a27b6bfc09fbbd18
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.5

Release files / lingo_api-23.0.5-cp312-cp312-win_amd64.whl

Download URL lingo_api-23.0.5-cp312-cp312-win_amd64.whl
Size 24.8 kB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
9f36c35be3be975363a61cc90d65377f64090e09050a4834432f14a777fef078
BLAKE2b-256 checksum
How to use checksums
f80738de5bbe12a8634997150bd66f0e68a0a046b7882430184da5c7e848ad5b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.10

Release files / lingo_api-23.0.5-cp312-cp312-manylinux_2_31_x86_64.manylinux_2_34_x86_64.whl

Download URL lingo_api-23.0.5-cp312-cp312-manylinux_2_31_x86_64.manylinux_2_34_x86_64.whl
Size 49.2 MB
Tags CPython 3.12 Linux glibc 2.31+ x86-64 Linux glibc 2.34+ x86-64
SHA-256 checksum
How to use checksums
d683798351c903a4d8461196dfd2c400927800c7faec5ee990bbf4ebe17b63b3
BLAKE2b-256 checksum
How to use checksums
a599b9e1d125d6732d312a3ec44dd6f5a98791493143289e41b8eda3f1cb8bee
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.5

Release files / lingo_api-23.0.5-cp311-cp311-win_amd64.whl

Download URL lingo_api-23.0.5-cp311-cp311-win_amd64.whl
Size 24.8 kB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
4f42db8070db72e581a0059a6d4bc80494d56718a4ad7e9f9a207a166b01a366
BLAKE2b-256 checksum
How to use checksums
a65d35ad15e317147fa05bbff66a0089d3c13867557977232233f8d3050cdf59
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.10

Release files / lingo_api-23.0.5-cp311-cp311-manylinux_2_31_x86_64.manylinux_2_34_x86_64.whl

Download URL lingo_api-23.0.5-cp311-cp311-manylinux_2_31_x86_64.manylinux_2_34_x86_64.whl
Size 49.2 MB
Tags CPython 3.11 Linux glibc 2.31+ x86-64 Linux glibc 2.34+ x86-64
SHA-256 checksum
How to use checksums
0627b8f1c83a6b9a000b362e89d7d5975cf7cd8041c24b7ebf1e2a6b1a0d1ef5
BLAKE2b-256 checksum
How to use checksums
d8720487324059638504127b4fcfe619183441e0f39fb4bef5cd82227b3c177e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.5

Release files / lingo_api-23.0.5-cp310-cp310-win_amd64.whl

Download URL lingo_api-23.0.5-cp310-cp310-win_amd64.whl
Size 24.8 kB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
b925e5158e2a599764dbffd16297ecd4ac3461fb4e5c699205f2d70cf20f2e82
BLAKE2b-256 checksum
How to use checksums
707ccd4f3fdf541a1bb8378594a4df8a8b5aba78f60e7c6ef6ab3f4513e32809
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.10

Release files / lingo_api-23.0.5-cp310-cp310-manylinux_2_31_x86_64.manylinux_2_34_x86_64.whl

Download URL lingo_api-23.0.5-cp310-cp310-manylinux_2_31_x86_64.manylinux_2_34_x86_64.whl
Size 49.2 MB
Tags CPython 3.10 Linux glibc 2.31+ x86-64 Linux glibc 2.34+ x86-64
SHA-256 checksum
How to use checksums
285d8722afda8984580206f83189f503eab944398ef6b2f870f66476d34aba7f
BLAKE2b-256 checksum
How to use checksums
6ba62e658a755ce28d80e41377889cc226e4667b7cda2351af578123e8775639
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.5

Release files / lingo_api-23.0.5-cp39-cp39-win_amd64.whl

Download URL lingo_api-23.0.5-cp39-cp39-win_amd64.whl
Size 24.8 kB
Tags CPython 3.9 Windows x86-64
SHA-256 checksum
How to use checksums
a8d1d47705069ae1272f2dd9d40612bb29e3222fae96d8e30c8e6815294a16f2
BLAKE2b-256 checksum
How to use checksums
78ee82e44f809f8cda5ac7b1578b38511da7c82c0ee4ee5de73aae1ad6e21d65
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.10

Release files / lingo_api-23.0.5-cp39-cp39-manylinux_2_31_x86_64.manylinux_2_34_x86_64.whl

Download URL lingo_api-23.0.5-cp39-cp39-manylinux_2_31_x86_64.manylinux_2_34_x86_64.whl
Size 49.2 MB
Tags CPython 3.9 Linux glibc 2.31+ x86-64 Linux glibc 2.34+ x86-64
SHA-256 checksum
How to use checksums
e22b94c560667b264ad8cdf0822e5f6563f7e2670739a67575250360565ee3c4
BLAKE2b-256 checksum
How to use checksums
8c608643508899138e4a5cbc1d8fe9a2b6a9324bf32775160eae336428c60fb1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.5

Security for lingo-api 23.0.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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