Error when trying to import pyomo.environ

1,905 views
Skip to first unread message

gers antifx

unread,
Apr 14, 2016, 8:44:36 AM4/14/16
to Pyomo Forum
Hey!

When I try to import
from pyomo.environ import *

I get the following error message: 

 pyomo.environ failed to import pyomo.pysp.plugins:
Original ImportError: cannot import name BasicSymbolMap


\Local\Continuum\Anaconda2\lib\site-packages\pyomo\environ\__init__.py", line 45, in _import_packages
    _do_import(pname)
  \Local\Continuum\Anaconda2\lib\site-packages\pyomo\environ\__init__.py", line 25, in _do_import
    __import__(pkg_name, globals(), locals(), [], -1)
Local\Continuum\Anaconda2\lib\site-packages\pyomo\pysp\__init__.py", line 29, in <module>
    import pyomo.pysp.ph
\Local\Continuum\Anaconda2\lib\site-packages\pyomo\pysp\ph.py", line 34, in <module>
    from pyomo.core.base import BasicSymbolMap, CounterLabeler

Would be great if someone could help!

Thank you very much

Gabriel Hackebeil

unread,
Apr 14, 2016, 8:47:42 AM4/14/16
to pyomo...@googlegroups.com
Take a look at this post. Let us know if that does not fix the issue.

Gabe

--
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.

gers antifx

unread,
Apr 14, 2016, 9:06:17 AM4/14/16
to Pyomo Forum
Hey! Thank you very much for your help!

I tried that, but get still the same error "pyomo.environ failed to import pyomo.pysp.plugins:

Original ImportError: cannot import name BasicSymbolMap
Traceback:"

I use Anaconda 64bit - tried it in Spyder and IPython --> get in both cases the same error.

Thank you for your help!!!

Gabriel Hackebeil

unread,
Apr 14, 2016, 9:23:23 AM4/14/16
to pyomo...@googlegroups.com
Well that’s not good.

What happens when you do “from pyomo.core import *”? Can you also provide the output from executing the following commands from the terminal:

$ pyomo --version
$ pyomo help --info

Gabe

Siirola, John D

unread,
Apr 14, 2016, 9:26:26 AM4/14/16
to pyomo...@googlegroups.com

Can we also start with some more basic questions:

-          what platform are you running on (it looks like a flavor of Windows)?

-          what version of Anaconda?

-          how did you install Pyomo?

 

john

gers antifx

unread,
Apr 14, 2016, 12:02:48 PM4/14/16
to pyomo...@googlegroups.com
Hey!

Thank you very much for your answers:
I tried it at my colleagues computer - got the same error.

- Windows 7 64bit
- Anaconda2-4.0.0-Windows-x86_64.exe
- first I installed Pyomo via pip --> then i followed the indroductions above

from pyomo.core import * --> worked.

in Spyder i can run: pyomo.version
<module 'pyomo.version' from '...\AppData\Local\Continuum\Anaconda2\lib\site-packages\pyomo\version\__init__.pyc'>

When I try it in IPython --> i can't run that command: "module" object has no attribute "version"

I cant run pyomo help --info


Thank you very much!!

r.saite...@gmail.com

unread,
Apr 15, 2016, 10:26:15 AM4/15/16
to Pyomo Forum
Hey!

I just faced the same problem, but in kubuntu, using a virtual environment.
My guess is that something in that pyomo-pip chain is broken which is why the installation with
pip install pyomo
apparently installs an outdated version of pyomo.pysp.ph.py which tries outdated imports from pyomo.core.base
What fixed it for me was getting the tarball for the latest pyomo version here: https://pypi.python.org/pypi/Pyomo/4.3.11328 and then installing it using

Hope this helps!
René

Bill Hart

unread,
Apr 15, 2016, 1:50:07 PM4/15/16
to Pyomo Forum
I just re-updated the PyPI Pyomo release.  Can someone try and confirm if this resolves this issue?

--Bill

gers antifx

unread,
Apr 16, 2016, 4:40:55 AM4/16/16
to Pyomo Forum
Great!!!! It works - thank you very much

René

unread,
Apr 16, 2016, 10:51:24 AM4/16/16
to Pyomo Forum
Yes,
pip install pyomo
seems to work again.
Thanks for the fix!
Reply all
Reply to author
Forward
0 new messages