简体   繁体   中英

Installed Python2.7 on centos 6 and now pip points to Python2.7 instead of Python version

我已经在centos 6 linux框中安装了python 2.7,当我使用easy_install和pip安装任何软件包时,请在Python2.7中安装它的安装...我需要在默认的Python2.6中安装一些软件包,我该怎么做?

You can check your pip version and which python it is pointed to

pip --version

That should give you some information about what to expect when calling pip. If you have pip 0.8 or better you can try pip-{version} .

pip-2.6 install some-package-you-want-in-2.6
pip-2.7 install some-package-you-want-in-2.7

If you are still having problems you are calling the correct version of python. Check that your $PYTHON_PATH env var points to Python 2.6.

echo $PYTHON_PATH

Will tell you where it is pointed at now. The value is likely set in your ~/.bashrc file. If that comes back blank you should set the PYTHON_PATH variable so you can easily configure what Python you are calling from the shell. Without the variable you shell will call the python linked in /usr/bin, changing the symlinking in /usr/bin which might give you headaches down the road because you'll be altering global behavior in your system.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM