-1

I'm using Anaconda 3 for my Python libraries. The problem is sometimes it works fine, but sometimes it returns an error. For example,

ModuleNotFoundError: No module named 'numpy'

I have checked the interpreter, and I already chose a correct one, but still this error happened. I am using Visual Studio Code as the code editor.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
  • It is usually fine with Anaconda even on Windows, but the canonical question for the general problem on Windows may be *[Error "Import Error: No module named numpy" on Windows](https://stackoverflow.com/questions/7818811/)* (2011, 40 answers and 300 votes). – Peter Mortensen Aug 22 '22 at 15:43

1 Answers1

0

IDEs like Anaconda tend to install their own virtual environment of Python to keep things clean and separated from your global Python. As a result, even if you have NumPy installed in your global Python, you cannot use it in your virtual environment since it has separate package management.

So first of all you have to:

  1. Open Anaconda Prompt from the Start Menu.

  2. Type the command conda install numpy and hit Enter.

  3. Wait for the setup to complete, and restart the Anaconda application.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Obaskly
  • 477
  • 2
  • 13