最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Pyomo ImportError: Cannot find reference 'NonNegativeReals' and 'Reals' in 'init.py&

programmeradmin1浏览0评论

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!

发布评论

评论列表(0)

  1. 暂无评论