Import Error No module named numpy

0 votes

The installation went fine but when I execute

import numpy

I got the following error:

Import error: No module named numpy

I know this is probably a super basic question, but I'm still learning.

Thanks

Apr 14, 2020 in Python by kartik
• 37,490 points
8,000 views

1 answer to this question.

0 votes

Hello,

I had numpy installed on the same environment both by pip and by conda, and simply removing and reinstalling either was not enough.

I had to reinstall both.

I don't know why it suddenly happened, but the solution was

pip uninstall numpy

conda uninstall numpy

uninstalling from conda also removed torch and torchvision.

then

conda install pytorch-cpu torchvision-cpu -c pytorch

and

pip install numpy

this resolved the issue for me.

answered Apr 14, 2020 by Niroj
• 82,560 points
conda uninstall numpy
conda install numpy

worked fine for me.

Related Questions In Python

0 votes
2 answers

Python error " import requests ImportError: No module named requests"

Hello, Open Cmd or Powershell as Admin. type pip ...READ MORE

answered Nov 28, 2020 in Python by Rohan
• 200 points
10,963 views
0 votes
1 answer
0 votes
3 answers

import NumPy as np ImportError: No module named NumPy

You need to install numpy using pip install ...READ MORE

answered Dec 16, 2020 in Python by Roshni
• 10,420 points
16,244 views
0 votes
1 answer

Python Requests module - Import Error: No module named requests

Run with Python 3 from the command ...READ MORE

answered Sep 11, 2020 in Python by Malik Brahimi
5,412 views
0 votes
2 answers
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 6, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 1,840 views
0 votes
0 answers
0 votes
1 answer

Error: import No module name urllib2

Hii, You have to install the modules like bs4, ...READ MORE

answered May 5, 2020 in Python by Niroj
• 82,560 points
983 views
0 votes
1 answer

Import error: No module name urllib2

As stated in the urllib2 documentation: The urllib2 module has been split ...READ MORE

answered May 11, 2020 in Python by Niroj
• 82,560 points
2,833 views