Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pyomo required by classiq is obsolete #17

Closed
ChienKaiMa opened this issue Apr 10, 2024 · 3 comments
Closed

Pyomo required by classiq is obsolete #17

ChienKaiMa opened this issue Apr 10, 2024 · 3 comments

Comments

@ChienKaiMa
Copy link
Contributor

ChienKaiMa commented Apr 10, 2024

Version

  • Python-3.12.1
  • classiq-0.9.3
  • Pyomo-6.0.1

How to replicate this problem

I created a conda environment (Python 3.12.1) and installed classiq (0.9.3).

$ pip install classiq
...
$ python3
>>> import classiq
...
.../lib/python3.12/site-packages/pyomo/core/base/component.py", line 427, in __getstate__
    state[key] = val
    ~~~~~^^^^^
TypeError: 'tuple' object does not support item assignment
>>>
  • This issue is not found in my older environment with Python 3.11.4.
  • I found a similar issue Issues #2600 is resolved by Pyomo team.

I have tried to force update the Pyomo package to 6.7.1, and imported classiq successfully with only a few deprecation warnings. I wonder this will break anything important.

$ pip install --force pyomo
...
$ python3
>>> import classiq
WARNING: DEPRECATED: the 'EqualityExpression' class has been moved to
'pyomo.core.expr.relational_expr.EqualityExpression'.  Please update your
import.  (deprecated in 6.4.3) (called from <frozen importlib._bootstrap>:488)
WARNING: DEPRECATED: the 'InequalityExpression' class has been moved to
'pyomo.core.expr.relational_expr.InequalityExpression'.  Please update your
import.  (deprecated in 6.4.3) (called from <frozen importlib._bootstrap>:488)
>>>

My suggestion

  • Update the import code and requirements.txt.
  • Use GitHub Actions to make sure mainstream versions can operate without problems.
@ChienKaiMa
Copy link
Contributor Author

I found the latest classiq package is 0.39.0, and checked the PyPI pages.
https://pypi.org/project/classiq/0.39.0/ shows "Requires: Python <3.12, >=3.8"
https://pypi.org/project/classiq/0.9.3/ shows "Requires: Python >=3.7, <4.0"
That's why pip found 0.9.3 and installed the old version.
Since the conda default installs Python 3.12, maybe it should be mentioned in the README.

@amir-naveh
Copy link
Member

Thank you @ChienKaiMa for raising this issue!
I agree, changing the README is a good idea 🙌.
Would you like to open a PR with the recommended changes? I will be happy to review and approve it.
Happy to get any more feedback from you.

ChienKaiMa added a commit to ChienKaiMa/classiq-library that referenced this issue Apr 12, 2024
amir-naveh pushed a commit that referenced this issue Apr 17, 2024
@amir-naveh
Copy link
Member

Handled by PR: #19.
Thanks!
Closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants