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

"np.float" in pyomo #3351

Closed
s-pirali opened this issue Aug 18, 2024 · 1 comment
Closed

"np.float" in pyomo #3351

s-pirali opened this issue Aug 18, 2024 · 1 comment
Labels

Comments

@s-pirali
Copy link

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):

@s-pirali s-pirali added the bug label Aug 18, 2024
@jsiirola
Copy link
Member

(another) duplicate of #3290; resolved by #3292

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

No branches or pull requests

2 participants