GMPL/MathProg magics for IPython/Jupyter
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

GMPL Magic: GMPL/MathProg Magics for IPython/Jupyter


Take a look at these example notebooks for details on how to use GMPL Magic — no installation required, thanks to Binder!


GMPL Magic has been tested with

  • Jupyter 4.2.0
  • Python 3.5.2
  • MetaKernel 0.14
  • PyGLPK 0.4.2, available from @bradfordboyle
  • GLPK 4.60


First, make sure you have a working installation of GLPK. For example, on macOS, this can be accomplished with Homebrew by:

brew update
brew tap homebrew/science
brew install glpk

(I will eventually include instructions on how to install GLPK on other operating systems.)

Next, install PyGLPK - note that the version on PyPI is outdated:

pip install

Then, install GMPL Magic:

pip install gmplmagic

To use these magics in a Jupyter notebook:

%load_ext glpkmagic