Pyomo / pyomo

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

PyInstaller fails when upgrading from Pyomo 6.7.1->6.7.3 #3283

Open vpranjal opened 3 months ago

vpranjal commented 3 months ago

Summary

The executable developed via pyinstaller on Pyomo 6.7.3 does not work properly and errors out on execution.

Steps to reproduce the issue

Ran a pyomo 6.7.1 model and tried to build an executable with .spec file (iteratively adding the missing hidden imports). This was successful and the executable worked as expected. However, when upgrading to 6.7.3 on the same project the executable does not work as expected and throws error.

Error Message

When running executable developed with 6.7.3:

File "", line 1360, in _find_and_load File "", line 1331, in _find_and_load_unlocked File "", line 921, in _load_unlocked File "", line 813, in module_from_spec File "pyomo\common\dependencies.py", line 468, in create_module AttributeError: 'NoneType' object has no attribute 'create_module' [10928] Failed to execute script 'main' due to unhandled exception!

Information on your system

Pyomo version: 6.7.1 and 6.7.3 Python version: 3.12 Operating system: Windows 11 How Pyomo was installed (PyPI, conda, source): PyPI Solver (if applicable): Highs

Additional information

Reverting as on now to 6.7.1 for executable developments, however would like this to work on 6.7.3 as well. Tested on two different PCs to ensure this is replicable and the same issue persisted with 6.7.3 (while 6.7.1 worked fine) with PyInstaller.