2

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?

3
  • You should install numpy with pip install numpy instead. It will add it to your python scripts folder, which is where the interpreter looks for packages. Commented Mar 6, 2019 at 5:26
  • @Jack: I need specific version of numpy as numpy_1.12.0-2~pn0_amd64.deb Commented Mar 6, 2019 at 5:27
  • Possible duplicate of Install a module using pip for specific python version Commented Mar 6, 2019 at 5:40

3 Answers 3

3

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

Sign up to request clarification or add additional context in comments.

1 Comment

raise ValueError(msg, line, "at", line[p:]) ValueError: ('Expected version spec in', 'python3-numpy_1.12.0-2~pn0_amd64.deb', 'at', '~pn0_amd64.deb')
2

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>

Comments

2

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

1 Comment

I need specific version of numpy as numpy_1.12.0-2~pn0_amd64.deb @Mayur

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.