Import error while importing SolverFactory and SolverManagerFactory

66 views
Skip to first unread message

seyyed ali pourmousavi

unread,
Apr 21, 2016, 5:05:54 PM4/21/16
to Pyomo Forum
Hello all,

I have an issue importing SolverFactory and SolverManagerFactory from pyomo. 

[Anaconda2] C:\Users\s.pourmousavi\Anaconda\DOPF\idems>python idems_main.py
Traceback (most recent call last):
  File "idems_main.py", line 14, in <module>
    from dopf import DOPF
  File "C:\Users\s.pourmousavi\Anaconda\DOPF\idems\dopf.py", line 13, in <module>
    from pyomo.environ import *
  File "C:\Users\s.pourmousavi\AppData\Local\Continuum\Anaconda2\lib\site-packages\pyomo\environ\__init__.py", line 14, in <module>
    from pyomo.opt import SolverFactory, SolverManagerFactory, UnknownSolver
ImportError: cannot import name UnknownSolver

I have Python 2.7 through Anaconda on Windows 7. I uninstalled all pyomo packages using  "pyomo_uninstall.py" and then installed Pyomo, Numpy, SciPy, and Pyomo.extras. I also can run the diet optimization problem with Pyomo and GLPK as the solver with no problem. That line of the code reads like this:

from pyomo.opt.parallel import SolverFactory, SolverManagerFactory

It is weird that although the code mentions "pyomo.opt.parallel", the output error only shows "pyomo.opt". The path is correct and pointing to the right .py file. I also tried "from pyomo.opt import SolverFactory, SolverManagerFactory", but no luck. Any suggestion?

thanks
Ali

seyyed ali pourmousavi

unread,
Apr 22, 2016, 11:39:03 AM4/22/16
to Pyomo Forum
the error was in pip installation. I tried "pip install web_link_to_the_latest_verstion" and it works now. 

William Hart

unread,
Apr 22, 2016, 11:44:57 AM4/22/16
to pyomo...@googlegroups.com
There was a problem with an upload of a recent PyPI release.  I think your error may have reflected that.

--Bill

--
You received this message because you are subscribed to the Google Groups "Pyomo Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyomo-forum...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages