Skip to main content

Python wrapper for polymake

Project description

What is it?

The Python module pypolymake provides wrappers for polymake.

The language has been kept as close as possible as the original. The following polymake construction:

polytope> $c = cube(5);
polytope> print $c->F_VECTOR;
32 80 80 40 10
polytope> $g = $c->GRAPH;
polytope> print $g->DIAMETER;

is translated in Python as:

>>> from polymake import *
>>> c = cube(5)
>>> print(c.F_VECTOR)
(32, 80, 80, 40, 10)
>>> g = c.GRAPH
>>> print(g.DIAMETER)

The library is currently under development and is compatible with Python2 and Python3. As it is under development, many things are not working and are likely to break.

Installation and source code

To install pypolymake you need polymake in version 3.0 or later together with its header files. You also need Cython.

The simplest way to install the package is to use:

$ pip install pypolymake --user

(the –user argument make the installation in your home directory and can be omitted if you have write access to your system). Alternatively, you can download (or clone) the source repository at and then run in that directory:

$ python install --user

If polymake headers or libraries are installed in a non standard location you may need to set the environment variables CFLAGS, CXXFLAGS, LDFLAGS. For example, on OS X, you need to update LDFLAGS as:

$ export LDFLAGS="-L/System/Library/Perl/5.18/darwin-thread-multi-2level/CORE/ $LDFLAGS"
$ python install --user

You might also need to set LD_LIBRARY_PATH before starting Python if the shared library of polymake ( is not in a standard directory.


The library pypolymake is distributed under the terms of the GNU General Public License (GPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version (see


This project has been started by Burcin Erocal in 2011 and continued by Vincent Delecroix in 2016

Project details

Download files

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

Source Distribution

pypolymake-0.1b5.tar.gz (233.2 kB view hashes)

Uploaded source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page