I am working on an optimization problem using Pyomo in Python. I have installed Pyomo successfully, but when I try to import the necessary libraries, I receive the following error:
from pyomo.environ import ( ConcreteModel, Set, Param, Var, NonNegativeReals, Reals, Objective, Constraint, value, SolverFactory, Expression ) Error Message:
Cannot find reference 'NonNegativeReals' in 'init.py' Cannot find reference 'Reals' in 'init.py'
What I have tried: 1- Reinstalling Pyomo: Ran pip uninstall pyomo followed by pip install pyomo Tried pip install --upgrade pyomo Still, the issue persists.
2- Installing specific dependencies manually: I tried installing individual Pyomo submodules, but this did not resolve the issue.
3- Checking Python version and environment:
Python version: 3.9.12 Running in pycharm pro Has anyone encountered this issue before? Any suggestions on how to resolve it?
System Information: Python version: 3.12 Pyomo version: 6.8.2 Operating System: Windows
Has anyone encountered this issue before? Any suggestions on how to resolve it?
Any help would be greatly appreciated!