将Pip安装到较旧的Python版本中 [英] Pip installing into an older Python version
问题描述
我正在尝试使用以下方式安装mysql-python:
I am trying to install mysql-python using:
pip install mysql-python
该软件包正在下面安装,尽管我已经在系统上安装了Python 2.6.
the package is being installed below, although I already have Python 2.6 on the system.
/Library/Python/2.5/site-packages
如何获得pip的安装位置:
How can I get pip to install in:
/Library/Python/2.6/site-packages
我尝试使用:
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...
推荐答案
您应该拥有pip-2.6.如果您没有pip 2.6版:
You should have pip-2.6. If you don't have pip version 2.6 :
您必须安装适用于Python 2.6的setuptools(例如:setuptools-0.6c11-py2.6.egg).然后,您有了easy_install-2.6.你可以做:
You have to install setuptools for Python 2.6 (example : setuptools-0.6c11-py2.6.egg). Then, you have easy_install-2.6. You can do :
easy_install-2.6 pip
最后,您拥有的是pip版本2.6.要安装mysql-python:
Finally, you have pip version 2.6. To install mysql-python :
pip-2.6 install mysql-python
这篇关于将Pip安装到较旧的Python版本中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!