I'm trying to install scipy on my virtual environment .venv on Windows with VS-code and it doesn't work. The error is
Collecting scipy==1.9.1
Using cached scipy-1.9.1.tar.gz (42.0 MB)
Installing build dependencies ... done
Getting requirements to build wheel ... error
error: subprocess-exited-with-error
I suppose that the issue comes from my virtual environment because the terminal mentions that
Failed to activate VS environment: Could not find C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe
I traied to change the version of scipy and to install other package like vswhere. All the soltuions that are mentionned on internet don't work. Can you help me, I'm a engineering student ?
Given the limited information you provided, you can try the following:
Delete the venv, make sure your global Python version is relatively up to date (I recommend 3.11.8 as of 2024-03-13), and recreate the venv; a venv is created using your current environment. You can also explore pyenv, which allows you to have multiple global environments to alternate between.
In VS Code, make sure you have the Python extension as well as the Python Extension Pack; the latter will install an environment manager. On the left sidebar, a Python logo will appear; click that and you can manage current environments and open specific environments in the Terminal from here. Make sure you run
python -m pip install scipy. The-mensures you're installing it in activated environment, rather than global Python.Reinstall VS Code or recheck how you're creating the venv.