user2129623
user2129623

Reputation: 2257

Numpy import error even after installing it with current python version

Note - I already check numpy import error related threads but none helped

I am using debian 8 where default python is 2.7.9. I installed python 3.4.2 and created virutal env.

Within virtual environment -

python -V
Python 3.4.2

pip -V
pip 1.5.6 from /path/venv34/lib/python3.4/site-packages (python 3.4)

I have python3 numpy package - python3-numpy_1.12.0-2~pn0_amd64.deb

which I have installed with sudo dpkg -i python3-numpy_1.12.0-2~pn0_amd64.deb

which successfully completed.

Now when I do

python
Python 3.4.2 (default, Feb  7 2019, 06:08:06) 
[GCC 4.9.2] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named 'numpy'
>>> 

Any clue what's wrong here?

Upvotes: 2

Views: 150

Answers (3)

Mayur
Mayur

Reputation: 5043

Try python -m pip install numpy==1.12.0. This should help you.

Upvotes: 2

Vikas Gautam
Vikas Gautam

Reputation: 249

ok since my repo is less than 50 i can not add comments, so take this answer as a comment to your question.

I think numpy is installed but not in your virtualenv, make sure your virtualenv is active when you are trying to install any library, you will see virtualenv name in every command line if it is activated.

(venv) C:\Users\seventeen\sprint25>

Upvotes: 2

Baltschun Ali
Baltschun Ali

Reputation: 366

python3.4 -m pip install numpy==1.12.0-2

Upvotes: 3

Related Questions