PyWavelets / pywt

PyWavelets - Wavelet Transforms in Python
http://pywavelets.readthedocs.org
MIT License
1.97k stars 460 forks source link

numpy.ndarray size changed, may indicate binary incompatibility. Expected 88 from C header, got 80 from PyObject #658

Closed QGN123 closed 1 year ago

QGN123 commented 1 year ago

8fc587e5eea8330044be5e5f4f9f1a3a

python3.7.13 numpy1.19.5 centos6

QGN123 commented 1 year ago

pywt 1.4.0

rgommers commented 1 year ago

@QGN123 can you please add how you installed Python, NumPy and PyWavelets?

rgommers commented 1 year ago

I checked, there were no wheels for 3.7, so this was a build from source. The pyproject.toml requirements say:

"numpy==1.17.3; python_version=='3.7' and (platform_machine!='arm64' or platform_system!='Darwin') and platform_machine!='aarch64' and platform_python_implementation != 'PyPy'",

So a pip install pywavelets should have built against numpy 1.17.3. At runtime, 1.19.5 must work then. The error message indicates that the wheel was somehow built against a newer numpy version than 1.19.5. Maybe you used python setup.py install in an environment with a newer numpy already installed?

Yanyu000 commented 1 year ago

I have the same issue. My python --version is Python 3.10.1 and numpy version is 1.24.2. I have tried to upgrade my numpy but it does not work. I need pywt to do my school project. I'd be grateful if this problem can be solved.

rgommers commented 1 year ago

This error is guaranteed to go away if you install the latest numpy. There's nothing else that can be done here - a pip install numpy pywavelets will always work.