Installed python 2.7.3 and all my libraries are on python 2.6.

I installed version 2.7.3, and whenever I type:

import numpy

I get an error saying that I do not have it. but when I run python 2.6, it imports it beautifully. The same thing happens with all my previous libraries: scipy, numpy, cv, cv2, networkx. I think this is due to switching the python library path for the new default version. How to do it?

+3
source share
4 answers

You need to install the library separately for each version of python. These libraries are not shared and should not be shared with another version of python.

+4
source

Python sys.path , , , , python2.6, python2.7, sys.path .

GNU/Linux, PATH=/path/to/py2.6/library:$PATH ~/.bashrc.

pip python2.7.

http://www.pip-installer.org/en/latest/index.html

python2.7 python2.6 , .

[EDIT]

$ curl -O https://raw.github.com/pypa/pip/master/contrib/get-pip.py
$ python get-pip.py

pip-2.7 pip .

+3

numpy, untar cd numpy ( root)

python2.7 setup.py install 

python 2.7 numpy . , .

, python, , Ubuntu . -

sudo cp -f $(which python2.7) $(which python)

, python - - .

+1

CentOS 6, python 2.6 , Yum . /usr/bin/python (, /usr/bin/orig-python). python 2.7:

ln -s /usr/local/bin/python2.7 /usr/bin/python

, .

, , $PATH, , .

+1

All Articles