Search code examples
pythonoptimizationpyomoenviron

Issue loading PYOMO. I cannot use Pyomo


I have tried to install pyomo with the extras in pip and also using later Conda. Everything shows to be fine but when I try to use it, I receive the following error.

from pyomo.environ import *

File "C:....\pyomo.py", line 8, in from pyomo.environ import *

ModuleNotFoundError: No module named 'pyomo.environ'; 'pyomo' is not a package

I can load pyomo, but not use it...

Does anyone know what could be happening?


Solution

  • If you named your script "pyomo.py" you might see this issue. In which case rename the file. Other possibility is that you don't have your conda environment activated.