Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I installed python3-numpy package, but trying to import it in Python3 interpreter I get this:

$ python3
Python 3.2.3 (default, May  3 2012, 15:54:42) 
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/zetah/.local/lib/python2.7/site-packages/numpy/", line 128, in <module>
    from version import git_revision as __git_revision__
ImportError: No module named version

Looking in Synaptic I see python3-numpy is installed in /usr/lib/python3/dist-packages/numpy/

Why is it picking wrong package and what can I do to remedy this?

share|improve this question
Please, add your last update as an answer and accept it. That will be better than closing the question. – Javier Rivera Jun 25 '12 at 13:40

In my ~/.profile file, probably following some online suggestion, I had this line:

export PYTHONPATH=$HOME/.local/lib/python2.7/site-packages:$PYTHONPATH

so PYTHONPATH env was pointing to folder where I build local Python packages (from source)

Removing above line from ~/.profile (which BTW could have been declared in ~/.bashrc also) resolves this issue and works perfectly. Even more exporting PYTHONPATH is unnecessary, as I found out soon

Hope it helps someone

share|improve this answer
nice catch, would you accept your own answer. – Sneetsher Jul 4 '15 at 3:19

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.