Problem with Python3 picking Python2 package
Posted
by
zetah
on Ask Ubuntu
See other posts from Ask Ubuntu
or by zetah
Published on 2012-06-25T00:57:30Z
Indexed on
2012/06/25
3:22 UTC
Read the original article
Hit count: 448
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?
Update:
OK, in my ~/.profile
I have this line:
PYTHONPATH=$PYTHONPATH:$HOME/.local/lib/python2.7/site-packages
but if I remove this line then my Python 2.7 local packages (which I build from source) wont work
Update 2:
Everything seems to work perfect without $PYTHONPATH
. I guess it was in my .profile
file for nothing
Please close this question
© Ask Ubuntu or respective owner