简体   繁体   English

将Pip安装到较旧的Python版本中

[英]Pip installing into an older Python version

I am trying to install mysql-python using: 我正在尝试使用以下命令安装mysql-python:

pip install mysql-python

the package is being installed below, although I already have Python 2.6 on the system. 该软件包正在下面安装,虽然我已经在系统上安装了Python 2.6。

/Library/Python/2.5/site-packages

How can I get pip to install in: 如何安装pip:

/Library/Python/2.6/site-packages

I tried using: 我试过用:

pip install --install-option="--prefix=/Library/Python/2.6/site-packages/" mysql-python

but that didn't work and it outputs: 但那不起作用,它输出:

    Requirement already satisfied (use --upgrade to upgrade): mysql-python in 
    /Library/Python/2.5/site-packages
    Cleaning up...

You should have pip-2.6. 你应该有pip-2.6。 If you don't have pip version 2.6 : 如果你没有pip版本2.6:

You have to install setuptools for Python 2.6 (example : setuptools-0.6c11-py2.6.egg). 您必须为Python 2.6安装setuptools(例如:setuptools-0.6c11-py2.6.egg)。 Then, you have easy_install-2.6. 然后,你有easy_install-2.6。 You can do : 你可以做 :

easy_install-2.6 pip

Finally, you have pip version 2.6. 最后,你有pip版本2.6。 To install mysql-python : 要安装mysql-python:

pip-2.6 install mysql-python

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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