Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use GLPK with cvxopt in Windows 10?

I use 64 bit Windows 10. I downloaded glpk-4.64 for Windows. I unzipped the file to my documents. I added the w64 path in this folder to Windows' environment variables. I check if the glpk works in command line by executing this:

C:\Users\userz>glpsol
GLPSOL: GLPK LP/MIP Solver, v4.64
No input problem file specified; try glpsol --help

So I think glpk is installed properly.

Then I install cvxopt using this in command line:

python -m pip install cvxopt

Then it installs cvxopt.

When I do:

import cvxopt.glpk

I get this error:

import cvxopt.glpk
ImportError: No module named glpk

So, how do I fix this?

like image 743
alwbtc Avatar asked Jan 19 '18 19:01

alwbtc


2 Answers

Installing cvxopt with the wheel file found at this link solved problem:

https://www.lfd.uci.edu/~gohlke/pythonlibs/#cvxopt

Many thanks to denfromufa.

like image 115
alwbtc Avatar answered Oct 10 '22 16:10

alwbtc


Installing numpy+mk from this link: http://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy and cvxopt with wheel file found in this link should solved problem: https://www.lfd.uci.edu/~gohlke/pythonlibs/#cvxopt

like image 35
Daniel I. Cruz Avatar answered Oct 10 '22 18:10

Daniel I. Cruz