Closed lbianchi-lbl closed 1 year ago
OK - This is because the pypi wheels have some cythonized modules and the relocated_module_attribute
function cannot correctly identify the calling module. #2644 will resolve this specific issue: both by updating relocated_module_attribute
so that it can work with cythonized modules and by adding a check that should prevent this from happening in the future.
Summary
This issue emerged as part of the IDAES release earlier today (a test in IDAES uses an import path that has been deprecated in pyomo 6.4.3, which is used below to reproduce the error), but it doesn't seem to be IDAES-specific.
It appears that the same version of Pyomo 6.4.3 results in different behaviors depending on whether it was installed from PyPI or from a source-like URL.
If pyomo 6.4.3 is installed from source, e.g. using
pip install "pyomo @ https://github.com/Pyomo/pyomo/archive/6.4.3.zip"
, then the deprecation infrastructure seems to work as expected:However, if the same version of Pyomo is installed from PyPI with
pip install pyomo==6.4.3
, the exact same import fails withImportError
:Steps to reproduce the issue
Error Message
Information on your system
Pyomo version: 6.4.3 Python version: 3.9 Operating system: Ubuntu 20.04.5 How Pyomo was installed (PyPI, conda, source): See above Solver (if applicable): N/A