Closed lensum closed 1 year ago
As far as I remember, the problem is caused by an incompatibility of old versions of pyomo with current numpy. Previously, before it was fixed by pyomo, we worked around this by setting a maximum version for numpy.
In fact, we could "depend on" pyomo >= 6.4.3
just because the older versions are known to be broken.
Somehow, this outlived itself quite quickly. Pyomo 6.6 changed the structure of its lp files, so #943 suggest to require it to be able to test everything.
Than I close this issue in favor of #943!
@Lensum: Would you mind leaving a review over there?
Describe the bug When installing oemof.solph via pip, the requirements for pyomo is given with:
"pyomo >= 6.0.0, < 7.0",
. However, simple code such as thebasic_example.py
does not run with thepyomo
versions between6.0.0
and6.4.2
(inclusive). The error returned points tosolph\buses\__init__.py
, line 471 with:TypeError: 'tuple' object does not support item assignment
With
pyomo >= 6.4.3
, the error vanishes.I see two options to fix that: 1) Change the code in
solph\buses\__init__.py
, or 2) Change thepyomo
-dependency to"pyomo >= 6.4.3, < 7.0"
I assume 2) will be easier to implement.
To Reproduce Steps to reproduce the behavior:
pip install oemof.solph
6.0.0 <= pyomo <= 6.4.2
, if not, runpip install --upgrade --force-reinstall pyomo==6.0.1
(or any other version that fits the previous requirement)basic_example.py
in the new venvpip install --upgrade --force-reinstall pyomo==6.4.3
(or higher)Expected behavior The examples should run with all versions specified in the install-requirements. (The expected behavior is ofc related to #922, but the reason for the error is not, I think).
Desktop (please complete the following information):
Additional context I should point out, that when only installing oemof.solph in a new environment,
pip
pulls the latest version ofpyomo
(6.5.0), so there won't be an error. But if other packages are installed beforehand, the pyomo version could be lower, so I think a fix would be great.