Trying to install Scipy on my virtual environment

29 views Asked by At

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 ?

1

There are 1 answers

0
Aidan Lee On

Given the limited information you provided, you can try the following:

  1. 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.

  2. 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 -m ensures you're installing it in activated environment, rather than global Python.

  3. Reinstall VS Code or recheck how you're creating the venv.