[pymprog] Failed to run a basic example
An easy and flexible mathematical programming environment for Python.
Brought to you by:
lanyjie
|
From: Rodrigo C. S. <rod...@gm...> - 2014-02-27 21:21:21
|
I tried to run the dive-in first example but an error appeared. Following
are the commands I entered and the error:
IDLE 1.2.4
>>> from pymprog import * # Import the module
# index and data
xid, rid = range(3), range(3)
c = (10.0, 6.0, 4.0)
mat = [ (1.0, 1.0, 1.0),
(10.0, 4.0, 5.0),
(2.0, 2.0, 6.0)]
b = (100.0, 600.0, 300.0)
#problem definition
beginModel('basic')
verbose(True)
x = var(xid, 'X') #create variables
maximize( #set objective
sum(c[i]*x[i] for i in xid), 'myobj'
)
r=st( #set constraints
sum(x[j]*mat[i][j] for j in xid) <= b[i] for i in rid
)
solve() #solve and report
print "Solver status:", status()
*Traceback (most recent call last):*
* File "<pyshell#0>", line 1, in <module>*
* from pymprog import * # Import the module*
* File "C:\Python25\lib\site-packages\pymprog.py", line 31, in <module>*
* from glpk import LPX*
*ImportError: DLL load failed with error code 193*
What could be the problem?
Thanks,
Rodrigo.
|