Retrieval-based-Voice-Conversion-WebUI icon indicating copy to clipboard operation
Retrieval-based-Voice-Conversion-WebUI copied to clipboard

"ImportError: No module named scipy" on step 2a

Open Mshriver2 opened this issue 1 year ago • 8 comments

When I attempt to click the "process data" button under the "Train" tab, I get the following error in terminal

Traceback (most recent call last):
  File "trainset_preprocess_pipeline_print.py", line 2, in <module>
    from scipy import signal
ImportError: No module named scipy

Any ideas what I can do to fix it? scipy is already shown as installed. image

Mshriver2 avatar Jun 07 '23 07:06 Mshriver2

I have my training folder path set to this folder full of vocal only .wavs (don't know why they say instrumental but they are only vocal) image

Mshriver2 avatar Jun 07 '23 07:06 Mshriver2

When running the scipy import command in the python3 interrupter I get the following. So it looks like it is installed so I am a bit confused of what the issue is. image

Mshriver2 avatar Jun 08 '23 05:06 Mshriver2

This is the specific error that goes in the console when clicking "process data". image

Mshriver2 avatar Jun 08 '23 05:06 Mshriver2

pip install scipy

i3l3 avatar Jun 11 '23 01:06 i3l3

pip install scipy

I have done both "pip install scipy" and "pip3 install scipy" both say they are already installed.

Mshriver2 avatar Jun 11 '23 22:06 Mshriver2

If I open a python terminal and do "from scipy import signal" it works just fine without error. However when I try to "process data" I get the error that their is no module. So I am very confused to what is happening. I pulled the latest commit today and the issue is still happening. image

Mshriver2 avatar Jun 12 '23 21:06 Mshriver2

I think it is trying to run the underlying script with python 2, which is normally referred by python command used in the script in Linux/Mac.

You could solve this by editing line 39 in config.py change "--pycmd", type=str, default="python", help="Python command" into "--pycmd", type=str, default="python3", help="Python command"

which could ask the environment to run those scripts with python 3, the one you installed scipy and other packages in.

then re-run python3 infer-web.py

ping42 avatar Jun 13 '23 06:06 ping42

I can reproduce this in Windows 11 (native) by running venv\Scripts\python infer-web.py directly without activating virtual environment first. The web will run but it won't able to find scipy.

EDIT2: Or modify config.py as per above but change it to default=sys.executable instead. Just make sure to import sys on top of the file first. EDIT: https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI/blob/7f4bdf42b01721de30848f661703df9524282114/config.py#L39

It needs to default to sys.executable instead of python.

MikuAuahDark avatar Jun 29 '23 01:06 MikuAuahDark

This solved my issue. Thanks guys

Mshriver2 avatar Jul 07 '23 06:07 Mshriver2