You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to use Pyomo library for optimization but when I call pyomo library in my code An error occurred due to the use of the np.float_ data type in the pyomo library
#part of my code is as below
import pyomo.environ as pyo
import pandas as pd
import numpy as np
model = pyo.AbstractModel ()
....
....
Error Message is as below:
C:\Users\Ten\AppData\Local\Programs\Python\Python310\python.exe -X pycache_prefix=C:\Users\Ten\AppData\Local\JetBrains\PyCharmCE2024.1\cpython-cache "C:/Program Files/JetBrains/PyCharm Community Edition 2024.1.3/plugins/python-ce/helpers/pydev/pydevd.py" --multiprocess --qt-support=auto --client 127.0.0.1 --port 11175 --file "K:\PHD\Thesis\Thesis\Simulation\My Simulation\Test_Simulation\PYOMO\Main_DOP_1.py"
Connected to pydev debugger (build 241.17890.14)
Traceback (most recent call last):
File "", line 1027, in _find_and_load
File "", line 1006, in _find_and_load_unlocked
File "", line 688, in _load_unlocked
File "", line 883, in exec_module
File "", line 241, in call_with_frames_removed
File "C:\Users\Ten\AppData\Local\Programs\Python\Python310\lib\site-packages\pandas_init.py", line 27, in import(_dependency)
File "", line 1027, in _find_and_load
File "", line 1006, in _find_and_load_unlocked
File "", line 688, in _load_unlocked
File "C:\Users\Ten\AppData\Local\Programs\Python\Python310\lib\site-packages\pyomo\common\dependencies.py", line 475, in exec_module
deferred.resolve()
File "C:\Users\Ten\AppData\Local\Programs\Python\Python310\lib\site-packages\pyomo\common\dependencies.py", line 334, in resolve
self._module, self._available = _perform_import(
File "C:\Users\Ten\AppData\Local\Programs\Python\Python310\lib\site-packages\pyomo\common\dependencies.py", line 768, in _perform_import
callback(module, True)
File "C:\Users\Ten\AppData\Local\Programs\Python\Python310\lib\site-packages\pyomo\common\dependencies.py", line 1002, in finalize_numpy floats = [np.float, np.float16, np.float32, np.float64]
File "C:\Users\Ten\AppData\Local\Programs\Python\Python310\lib\site-packages\numpy_init.py", line 411, in getattr
raise AttributeError(
AttributeError: np.float_ was removed in the NumPy 2.0 release. Use np.float64 instead.. Did you mean: 'float16'?
python-BaseException
Information on your system
Pyomo version: 6.7.3
Python version: 3.10
Numpy Version: 1.24.3
Operating system: windows
How Pyomo was installed (PyPI, conda, source): PyPI
Solver (if applicable):
The text was updated successfully, but these errors were encountered:
I want to use Pyomo library for optimization but when I call pyomo library in my code An error occurred due to the use of the np.float_ data type in the pyomo library
#part of my code is as below
import pyomo.environ as pyo
import pandas as pd
import numpy as np
model = pyo.AbstractModel ()
....
....
Error Message is as below:
C:\Users\Ten\AppData\Local\Programs\Python\Python310\python.exe -X pycache_prefix=C:\Users\Ten\AppData\Local\JetBrains\PyCharmCE2024.1\cpython-cache "C:/Program Files/JetBrains/PyCharm Community Edition 2024.1.3/plugins/python-ce/helpers/pydev/pydevd.py" --multiprocess --qt-support=auto --client 127.0.0.1 --port 11175 --file "K:\PHD\Thesis\Thesis\Simulation\My Simulation\Test_Simulation\PYOMO\Main_DOP_1.py"
Connected to pydev debugger (build 241.17890.14)
Traceback (most recent call last):
File "", line 1027, in _find_and_load
File "", line 1006, in _find_and_load_unlocked
File "", line 688, in _load_unlocked
File "", line 883, in exec_module
File "", line 241, in call_with_frames_removed
File "C:\Users\Ten\AppData\Local\Programs\Python\Python310\lib\site-packages\pandas_init.py", line 27, in
import(_dependency)
File "", line 1027, in _find_and_load
File "", line 1006, in _find_and_load_unlocked
File "", line 688, in _load_unlocked
File "C:\Users\Ten\AppData\Local\Programs\Python\Python310\lib\site-packages\pyomo\common\dependencies.py", line 475, in exec_module
deferred.resolve()
File "C:\Users\Ten\AppData\Local\Programs\Python\Python310\lib\site-packages\pyomo\common\dependencies.py", line 334, in resolve
self._module, self._available = _perform_import(
File "C:\Users\Ten\AppData\Local\Programs\Python\Python310\lib\site-packages\pyomo\common\dependencies.py", line 768, in _perform_import
callback(module, True)
File "C:\Users\Ten\AppData\Local\Programs\Python\Python310\lib\site-packages\pyomo\common\dependencies.py", line 1002, in finalize_numpy
floats = [np.float, np.float16, np.float32, np.float64]
File "C:\Users\Ten\AppData\Local\Programs\Python\Python310\lib\site-packages\numpy_init.py", line 411, in getattr
raise AttributeError(
AttributeError:
np.float_
was removed in the NumPy 2.0 release. Usenp.float64
instead.. Did you mean: 'float16'?python-BaseException
Information on your system
Pyomo version: 6.7.3
Python version: 3.10
Numpy Version: 1.24.3
Operating system: windows
How Pyomo was installed (PyPI, conda, source): PyPI
Solver (if applicable):
The text was updated successfully, but these errors were encountered: