close

[Solved] No module named ‘numpy’: Visual Studio Code

Hello Guys, How are you all? Hope You all Are Fine. Today I get the following error No module named ‘numpy’: Visual Studio Code in python. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

How No module named ‘numpy’: Visual Studio Code Error Occurs?

Today I get the following error No module named ‘numpy’: Visual Studio Code in python.

How To Solve No module named ‘numpy’: Visual Studio Code Error ?

  1. How To Solve No module named 'numpy': Visual Studio Code Error ?

    To Solve No module named 'numpy': Visual Studio Code Error ou may not have numpy installed on the version of python you are running.

  2. No module named 'numpy': Visual Studio Code

    To Solve No module named 'numpy': Visual Studio Code Error ou may not have numpy installed on the version of python you are running.

Solution 1

ou may not have numpy installed on the version of python you are running.

Try this:

import sys

print(sys.version)

Is the printed version Anaconda? If you installed Anaconda python, it should come with numpy already installed. If it turns out to be another version of python you are accessing inside Visual Studio Code that doesn’t have numpy installed, then that’s what you need to fix.

The version of python that is called depends on which version of python comes up in your PATH variable first. Type into a terminal: echo $PATH. The output should look like this with Anaconda bin first: /Users/jlzhang/anaconda/bin:/usr/local/bin:/usr/bin:/bin

If you do not have Anaconda bin first, you can add this to your ~/.bashrc file: echo

# Use Anaconda python

export PATH=”/Users/jlzhang/anaconda/bin:$PATH”

Restart a terminal and Visual Studio Code and see if you are now running Anaconda python.

Hope it helps/ Did it work?

Solution 2

if you are at VSC jupyter, you should check this:

Like this (You can see this at the top right)

Summery

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you? Thank You.

Also, Read