chipmuenk/pyfda

pyfdax won't start with numpy 2.0

Closed this issue · 2 comments

~$ pyfdax
A module that was compiled using NumPy 1.x cannot be run in
NumPy 2.0.0 as it may crash. To support both 1.x and 2.x
versions of NumPy, modules must be compiled with NumPy 2.0.
Some module may need to rebuild instead e.g. with 'pybind11>=2.12'.

OS: Ubuntu 24.04 LTS

Traceback (most recent call last): File "/home/sergei/.local/bin/pyfdax", line 5, in
from pyfda.pyfdax import main
File "/home/sergei/.local/share/pipx/venvs/pyfda/lib/python3.12/site-packages/pyfda/pyfdax.py", line 19, in
import pyfda.pyfda_rc as rc
File "/home/sergei/.local/share/pipx/venvs/pyfda/lib/python3.12/site-packages/pyfda/pyfda_rc.py", line 22, in
from pyfda.libs.pyfda_lib import CRLF, cmp_version
File "/home/sergei/.local/share/pipx/venvs/pyfda/lib/python3.12/site-packages/pyfda/libs/pyfda_lib.py", line 21, in
import numexpr
File "/home/sergei/.local/share/pipx/venvs/pyfda/lib/python3.12/site-packages/numexpr/init.py", line 24, in
from numexpr.interpreter import MAX_THREADS, use_vml, BLOCK_SIZE1
Traceback (most recent call last):
File "/home/sergei/.local/share/pipx/venvs/pyfda/lib/python3.12/site-packages/numpy/core/_multiarray_umath.py", line 44, in getattr
raise ImportError(msg)
ImportError:
A module that was compiled using NumPy 1.x cannot be run in
NumPy 2.0.0 as it may crash. To support both 1.x and 2.x
versions of NumPy, modules must be compiled with NumPy 2.0.
Some module may need to rebuild instead e.g. with 'pybind11>=2.12'.

If you are a user of the module, the easiest solution will be to
downgrade to 'numpy<2' or try to upgrade the affected module.
We expect that some modules will need time to support NumPy 2.

Traceback (most recent call last):
File "/home/sergei/.local/bin/pyfdax", line 5, in
from pyfda.pyfdax import main
File "/home/sergei/.local/share/pipx/venvs/pyfda/lib/python3.12/site-packages/pyfda/pyfdax.py", line 19, in
import pyfda.pyfda_rc as rc
File "/home/sergei/.local/share/pipx/venvs/pyfda/lib/python3.12/site-packages/pyfda/pyfda_rc.py", line 22, in
from pyfda.libs.pyfda_lib import CRLF, cmp_version
File "/home/sergei/.local/share/pipx/venvs/pyfda/lib/python3.12/site-packages/pyfda/libs/pyfda_lib.py", line 21, in
import numexpr
File "/home/sergei/.local/share/pipx/venvs/pyfda/lib/python3.12/site-packages/numexpr/init.py", line 24, in
from numexpr.interpreter import MAX_THREADS, use_vml, BLOCK_SIZE1
ImportError: numpy.core.multiarray failed to import

Thanks for reporting, the failure seems to be caused by the numexpr module which is not yet ready for numpy 2.0. I haven't tried to make pyfda compatible with numpy 2.0, so the only workaround I can offer at the moment is to downgrade to numpy 1.x.

I'll change the requirements to numpy < 2.0