Pyomo / pyomo

An object-oriented algebraic modeling language in Python for structured optimization problems.
https://www.pyomo.org
Other
2.01k stars 518 forks source link

Unable to import pyomo.environ on python 3.11 #2600

Closed trigaut closed 1 year ago

trigaut commented 1 year ago

Summary

With pyomo 6.4.2 on python 3.11 importing pyomo.environ raises an error.

Steps to reproduce the issue

import pyomo.environ as pyo

Error Message

pyomo\core\base\component.py", line 471, in __getstate__
    state[key] = val
    ~~~~~^^^^^
TypeError: 'tuple' object does not support item assignment

Information on your system

Pyomo version: 6.4.2 Python version: 3.11 Operating system: Windows 10 How Pyomo was installed: Pypi

blnicho commented 1 year ago

This was resolved in main by https://github.com/Pyomo/pyomo/pull/2596 and will be part of the next release (currently scheduled for Nov 21).