简体   繁体   中英

Python: "ModuleNotFoundError: No module named 'numpy'"

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM