Glam Prestige Journal

Bright entertainment trends with youth appeal.

I want to install python-glpk I followed the instructions here:

But when I tried to do this:

import glpk
print glpk.glp_version()

I have these errors

enter image description here

Thank you

1

1 Answer

Bug

For Ubuntu 16.04 LTS it is known issue - it was reported to LaunchPad.net on 2016-10-02 as bug 1629672.

Fix

We can fix this bug by installation of previous version of python-ply component with pip into your home folder:

#sudo apt-get install python-glpk # you did this before in question
sudo apt-get install python-pip
pip install ply==3.4 --user

And then test it with simple script (name it glpk_test.py) with contents:

#!/usr/bin/python2
import glpk
print glpk.glp_version()

then make it executable with chmod +x glpk_test.py and execute with ./glpk_test.py.

The output on Ubuntu 16.04 LTS will be:

4.57
2

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy