Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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/__init__.py", 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
add comment

1 Answer

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
add comment

Your Answer

 
discard

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.