voicefixer icon indicating copy to clipboard operation
voicefixer copied to clipboard

Numpy error

Open Sinicyn78 opened this issue 1 year ago • 1 comments

(Voicefixer) C:\Temp\voicefixer>voicefixer --help Traceback (most recent call last): File "", line 189, in run_module_as_main File "", line 148, in get_module_details File "", line 112, in get_module_details File "C:\Temp\voicefixer\voicefixer_init.py", line 13, in from voicefixer.vocoder.base import Vocoder File "C:\Temp\voicefixer\voicefixer\vocoder\base.py", line 2, in from voicefixer.tools.wav import read_wave, save_wave File "C:\Temp\voicefixer\voicefixer\tools\wav.py", line 6, in import librosa File "C:\Temp\voicefixer\venv\Lib\site-packages\librosa_init.py", line 211, in from . import core File "C:\Temp\voicefixer\venv\Lib\site-packages\librosa\core_init.py", line 9, in from .constantq import * # pylint: disable=wildcard-import ^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Temp\voicefixer\venv\Lib\site-packages\librosa\core\constantq.py", line 1059, in dtype=np.complex, ^^^^^^^^^^ File "C:\Temp\voicefixer\venv\Lib\site-packages\numpy_init_.py", line 338, in getattr raise AttributeError(former_attrs[attr]) 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; for more details and guidance see the original release note at: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations. Did you mean: 'complex_'?

Sinicyn78 avatar Oct 31 '23 14:10 Sinicyn78

A part solution is here.

Following the installation directions (modified for conda env), I got this same error as Sinicyn78, running on Python 3.9.

        1. conda create --name python-voicefixer  python=3.9
        2. conda activate python-voicefixer
        3. pip install voicefixer==0.1.2
        4. conda install git
        5. git clone https://github.com/haoheliu/voicefixer.git
        6. cd voicefixer
        7. python test/test.py # test script

However, after altering the librosa files following the directions in the issue below (issue 48), I can now use VoiceFixer in modes 0 and 2 (not 1) without issue, which works for my project. Another person on that thread looks like they got to the same place by installing a previous version of librosa, but I can't speak to that.

https://github.com/haoheliu/voicefixer/issues/48#issuecomment-1636795850

andrew-r-marchand avatar Nov 10 '23 17:11 andrew-r-marchand