Quantcast
Channel: Active questions tagged numpy - Stack Overflow
Viewing all articles
Browse latest Browse all 5817

Unable to downgrade numpy for compatibility with librosa 0.8.1

$
0
0

I need to use librosa 0.8.1 for compatibility but cannot seem to downgrade it; or rather, I can downgrade it, but an incompatibility with the latest version of numpy followed by an inability to downgrade numpy is preventing me from using it.

I first used pip install librosa==0.8.1 to get the version of librosa I needed. However, when trying to import this into my project, I'm getting a numpy package error.

AttributeError: module 'numpy' has no attribute 'complex'.`np.complex` was a deprecated alias for the builtin `complex`. To avoid this error in existing code, use `complex` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.complex128` here.The aliases was originally deprecated in NumPy 1.20.

It seems librosa 0.8.1 is incompatible with numpy 1.26.4. But, this is the version of numpy that was installed automatically when I ran pip install librosa==0.8.1. It seems this issue is fixed in librosa 0.9.x but I need the earlier version.

I tried pip uninstall numpy followed by pip install numpy=1.19.2 but this failed with the error,

ModuleNotFoundError: No module named 'setuptools.extern.six'

I tried pip install --upgrade numpy==1.19.2 and pip install --force-reinstall numpy==1.19.2. I tried using pip3 and installing a different version numpy 1.19.5. All had the same error. I have the latest version of setuptools installed.

I tried python -m pip even though I only have one version of python (python 3.12.2 x64) on my machine. This failed too.

I am not sure whether the fix lies with setuptools or whether there is an alternative to downgrading numpy. I do not mind if I cannot downgrade numpy, I just want to be able to use librosa 0.8.1, without incompatibility errors preventing me.

Any help would be greatly appreciated!


Viewing all articles
Browse latest Browse all 5817

Trending Articles