[SciPy-user] openopt ImportError: cannot import name oovar

Nils Wagner nwagner@iam.uni-stuttgart...
Sun Oct 12 03:55:39 CDT 2008


On Sat, 11 Oct 2008 22:17:33 +0300
  dmitrey <dmitrey.kroshko@scipy.org> wrote:
> I checked out openopt from svn and it works for me.
> Does anyone else has the problem?
> 
> D.
> 
> Nils Wagner wrote:
>> python -i 
>> svn/openopt/scikits/openopt/examples/oofun/speedup.py
>> Traceback (most recent call last):
>>    File 
>> "svn/openopt/scikits/openopt/examples/oofun/speedup.py", 
>> line 28, in <module>
>>      from scikits.openopt import NLP,  oofun,  oovar
>> ImportError: cannot import name oovar
>>
  
Strange.
I can import oovar on my old laptop (python2.4).

Python 2.4 (#1, Oct 13 2006, 17:13:31)
[GCC 3.3.5 20050117 (prerelease) (SUSE Linux)] on linux2
Type "help", "copyright", "credits" or "license" for more 
information.
>>> from scikits.openopt import oovar
>>>               

Another python2.4 issue is present

  python -i 
svn/openopt/scikits/openopt/examples/oofun/speedup.py
Traceback (most recent call last):
   File 
"svn/openopt/scikits/openopt/examples/oofun/speedup.py", 
line 38, in ?
     r = p.solve(solver)
   File 
"/usr/lib/python2.4/site-packages/scikits/openopt/Kernel/BaseProblem.py", 
line 201, in solve
     return runProbSolver(self, *args, **kwargs)
   File 
"/usr/lib/python2.4/site-packages/scikits/openopt/Kernel/runProbSolver.py", 
line 102, in runProbSolver
     p.__prepare__()
   File 
"/usr/lib/python2.4/site-packages/scikits/openopt/Kernel/BaseProblem.py", 
line 385, in __prepare__
     self.__construct_x_from_ooVars__()
   File 
"/usr/lib/python2.4/site-packages/scikits/openopt/Kernel/BaseProblem.py", 
line 370, in __construct_x_from_ooVars__
     var.__initialize__(self)
   File 
"/usr/lib/python2.4/site-packages/scikits/openopt/Kernel/ooVar.py", 
line 63, in __initialize__
     if any(self.lb > self.ub):
NameError: global name 'any' is not defined

Nils


More information about the SciPy-user mailing list