Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Linux Build Status

Windows Build status

cbcpy

Native Python interface for Coin-or Branch and Cut Solver (Cbc).

Description

This project provide the build mechanism to automatically generate the wrapper code between Cbc C++ code and Python using SWIG.

This project was develop as part of the CBC Coin-or Sprint Aug 2019.

Binaries for the following platform are pre-compiled and available on pypi.

  • linux x86_64 / python 2.7
  • linux x86_64 / python 3.5
  • linux x86_64 / python 3.6
  • linux x86_64 / python 3.7
  • win x86 / python 2.7
  • win x86 / python 3.5
  • win x86 / python 3.6
  • win x86 / python 3.7
  • win x86_64 / python 3.5
  • win x86_64 / python 3.6
  • win x86_64 / python 3.7

Linux x86 is not supported.

Installation

Pre-compiled python packages are deployed to cbcpy Pypi repositories. To install cbcpy you should make use of pip command line:

pip install cbcpy

The packages include pre-compiled version of Cbc.

For Windows: You must install Visual C++ Redistributable for VS2015

Usage

Here a minimalistic python script making use of cbcpy. You may download p0033.mps from here.

import cbcpy as cbc
solver1 = cbc.OsiClpSolverInterface()
solver1.readMps("p0033.mps")
model = cbc.CbcModel(solver1)
model.branchAndBound()
numberColumns = model.solver().getNumCols()
p_solution = model.solver().getColSolution()
solution = cbc.doubleArray_frompointer(p_solution)

for i in range(numberColumns):
  value = solution[i]
  print("%s has value %s" % (i, value))

Documentation

Original documentation from Cbc project is available in python using the help() function.

# python
Python 2.7.16 (default, Jul 13 2019, 16:01:51) 
[GCC 8.3.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import cbcpy
>>> help(cbcpy)
Help on module cbcpy:

Troubleshooting

The specified module could not be found.

>>> import cbcpy
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Python37-32\lib\site-packages\cbcpy.py", line 15, in <module>
    import _cbcpy
ImportError: DLL load failed: The specified module could not be found.

This error might occur on Windows platform when the file msvcp140.dll cannot be found. You must install Visual C++ Redistributable for VS2015. For 32-bit download "vc_redist.x86.exe" file and for 64-bit download "vc_redist.x64.exe" file.

Support

To get community help for cbcpy, you may send email to the Cbc mailing list.

You may also get paid support by contacting Patrik Dufresne Service Logiciel.

Release files for cbcpy 2.10.3a2

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 cbcpy 2.10.3a2
File
cbcpy-2.10.3a2-cp37-cp37m-win_amd64.whl CPython 3.7 CPython 3.7 pymalloc Windows x86-64 Details
cbcpy-2.10.3a2-cp37-cp37m-win32.whl CPython 3.7 CPython 3.7 pymalloc Windows x86-32 Details
cbcpy-2.10.3a2-cp37-cp37m-manylinux2010_x86_64.whl CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.12+ x86-64 Details
cbcpy-2.10.3a2-cp36-cp36m-win_amd64.whl CPython 3.6 CPython 3.6 pymalloc Windows x86-64 Details
cbcpy-2.10.3a2-cp36-cp36m-win32.whl CPython 3.6 CPython 3.6 pymalloc Windows x86-32 Details
cbcpy-2.10.3a2-cp36-cp36m-manylinux2010_x86_64.whl CPython 3.6 CPython 3.6 pymalloc Linux glibc 2.12+ x86-64 Details
cbcpy-2.10.3a2-cp35-cp35m-win_amd64.whl CPython 3.5 CPython 3.5 pymalloc Windows x86-64 Details
cbcpy-2.10.3a2-cp35-cp35m-win32.whl CPython 3.5 CPython 3.5 pymalloc Windows x86-32 Details
cbcpy-2.10.3a2-cp35-cp35m-manylinux2010_x86_64.whl CPython 3.5 CPython 3.5 pymalloc Linux glibc 2.12+ x86-64 Details
cbcpy-2.10.3a2-cp27-cp27mu-manylinux2010_x86_64.whl CPython 2.7 CPython 2.7 pymalloc wide-unicode Linux glibc 2.12+ x86-64 Details
cbcpy-2.10.3a2-cp27-cp27m-manylinux2010_x86_64.whl CPython 2.7 CPython 2.7 pymalloc Linux glibc 2.12+ x86-64 Details

Total release size: 34.0 MB

Release files / cbcpy-2.10.3a2-cp37-cp37m-win_amd64.whl

Download URL cbcpy-2.10.3a2-cp37-cp37m-win_amd64.whl
Size 2.1 MB
Tags CPython 3.7 CPython 3.7 pymalloc Windows x86-64
SHA-256 checksum
How to use checksums
6790d5037cf3bdf1b6673fde598d4d5be495c61d99fe4f53c1c04139c5c95555
BLAKE2b-256 checksum
How to use checksums
8e1c2e6e942b75bb32f0a947ab25667de0c61680ad74947fe87ffb32be5b8f7a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.34.0 CPython/3.7.4

Release files / cbcpy-2.10.3a2-cp37-cp37m-win32.whl

Download URL cbcpy-2.10.3a2-cp37-cp37m-win32.whl
Size 1.7 MB
Tags CPython 3.7 CPython 3.7 pymalloc Windows x86-32
SHA-256 checksum
How to use checksums
e481ccfefc6cd46757dcafb63fd73b5299cfae68ed8adc48e3523818bc7ea3a5
BLAKE2b-256 checksum
How to use checksums
237efb5018f18f85dc5f9fbe7331227abc815b61a4d386fba1642bc3a9c09f15
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.34.0 CPython/3.7.4

Release files / cbcpy-2.10.3a2-cp37-cp37m-manylinux2010_x86_64.whl

Download URL cbcpy-2.10.3a2-cp37-cp37m-manylinux2010_x86_64.whl
Size 4.5 MB
Tags CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.12+ x86-64
SHA-256 checksum
How to use checksums
c8f613c22b0c46e3ecb5b748dbdcf14045563b2bbe1f621700d2410ca4984016
BLAKE2b-256 checksum
How to use checksums
7aed9d1edfaf1edfb51b3df9790034edeb422f92f0c4c93ef6707d83209964c0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.1.0 requests-toolbelt/0.9.1 tqdm/4.34.0 CPython/3.7.4

Release files / cbcpy-2.10.3a2-cp36-cp36m-win_amd64.whl

Download URL cbcpy-2.10.3a2-cp36-cp36m-win_amd64.whl
Size 2.1 MB
Tags CPython 3.6 CPython 3.6 pymalloc Windows x86-64
SHA-256 checksum
How to use checksums
158db379924be24f659015d6f2d96ac45a3568a8dd8ad590a1a21ee64c7e89ed
BLAKE2b-256 checksum
How to use checksums
f1e64f5714c7a1c7923347ac828372387c949a6d0f2d8dd093989dd72f6af3ca
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.34.0 CPython/3.6.8

Release files / cbcpy-2.10.3a2-cp36-cp36m-win32.whl

Download URL cbcpy-2.10.3a2-cp36-cp36m-win32.whl
Size 1.7 MB
Tags CPython 3.6 CPython 3.6 pymalloc Windows x86-32
SHA-256 checksum
How to use checksums
66707a44ed09dfbd5f0fce034946eeaba0f085aa2662cf3eee06298360f4f3db
BLAKE2b-256 checksum
How to use checksums
fc4d87d6b05314b57633e13760843a137924d817d854051da9dc7f5d6ceab467
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.34.0 CPython/3.6.8

Release files / cbcpy-2.10.3a2-cp36-cp36m-manylinux2010_x86_64.whl

Download URL cbcpy-2.10.3a2-cp36-cp36m-manylinux2010_x86_64.whl
Size 4.5 MB
Tags CPython 3.6 CPython 3.6 pymalloc Linux glibc 2.12+ x86-64
SHA-256 checksum
How to use checksums
f4ad3509e9b7d336f7eb3cb83226e547fd5e4504ca526d8201d866db650ff825
BLAKE2b-256 checksum
How to use checksums
04781e42ce001f8b1247a3168221d30d5543b0c1cb3d04b72fc36871f2d478de
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.1.0 requests-toolbelt/0.9.1 tqdm/4.34.0 CPython/3.7.4

Release files / cbcpy-2.10.3a2-cp35-cp35m-win_amd64.whl

Download URL cbcpy-2.10.3a2-cp35-cp35m-win_amd64.whl
Size 2.1 MB
Tags CPython 3.5 CPython 3.5 pymalloc Windows x86-64
SHA-256 checksum
How to use checksums
ea1f2a64518f44ca2a33fec473e4f0874a5ef504f115a1b071b7d794088edfcb
BLAKE2b-256 checksum
How to use checksums
081dc33ff376045d07da522909b8bac9d3e986689bedd6a44467492d7737f728
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/28.8.0 requests-toolbelt/0.9.1 tqdm/4.34.0 CPython/3.5.4

Release files / cbcpy-2.10.3a2-cp35-cp35m-win32.whl

Download URL cbcpy-2.10.3a2-cp35-cp35m-win32.whl
Size 1.7 MB
Tags CPython 3.5 CPython 3.5 pymalloc Windows x86-32
SHA-256 checksum
How to use checksums
701012af5fd4107cae0f0eef61c0d79a8e94cdbabbc1e607eecd0a6d96f836ca
BLAKE2b-256 checksum
How to use checksums
41d799ef7f25e11b3d0443c87a33bd0948d734cd570111cf2e57fddbc2c1af57
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/28.8.0 requests-toolbelt/0.9.1 tqdm/4.34.0 CPython/3.5.4

Release files / cbcpy-2.10.3a2-cp35-cp35m-manylinux2010_x86_64.whl

Download URL cbcpy-2.10.3a2-cp35-cp35m-manylinux2010_x86_64.whl
Size 4.5 MB
Tags CPython 3.5 CPython 3.5 pymalloc Linux glibc 2.12+ x86-64
SHA-256 checksum
How to use checksums
4c52f956e6cdf2cb3d2db79f25162ca8c014d8ba718e24836fe91d366ab1b2b1
BLAKE2b-256 checksum
How to use checksums
fc292efed5c70b0ccea7e38757f55f0611edccd7dbe66f9e8a697ade28f555ad
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.1.0 requests-toolbelt/0.9.1 tqdm/4.34.0 CPython/3.7.4

Release files / cbcpy-2.10.3a2-cp27-cp27mu-manylinux2010_x86_64.whl

Download URL cbcpy-2.10.3a2-cp27-cp27mu-manylinux2010_x86_64.whl
Size 4.5 MB
Tags CPython 2.7 CPython 2.7 pymalloc wide-unicode Linux glibc 2.12+ x86-64
SHA-256 checksum
How to use checksums
ced246496fde73b3d0cb3beada6f2c7180aa7df9c3e688235a6267f4ca491472
BLAKE2b-256 checksum
How to use checksums
d0886038858a4701d53caba40f694566fbbe8fcffe1837b414031c02fe2f0aed
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.1.0 requests-toolbelt/0.9.1 tqdm/4.34.0 CPython/3.7.4

Release files / cbcpy-2.10.3a2-cp27-cp27m-manylinux2010_x86_64.whl

Download URL cbcpy-2.10.3a2-cp27-cp27m-manylinux2010_x86_64.whl
Size 4.5 MB
Tags CPython 2.7 CPython 2.7 pymalloc Linux glibc 2.12+ x86-64
SHA-256 checksum
How to use checksums
fd75c058a5d0fb4e7c05f315ce25ac9d59f11f098b6216ccb1c85b33fc04d970
BLAKE2b-256 checksum
How to use checksums
4fa07ed15fc2dd50b31f02b52c99e8ddca28a736d4ac9b3b85269d3e9c3269cb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.1.0 requests-toolbelt/0.9.1 tqdm/4.34.0 CPython/3.7.4

Release history Release notifications | RSS feed

This release

2.10.3a2 This release

11 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