Pip installing into an older Python version

2019-01-23 05:00发布

I am trying to install mysql-python using:

pip install mysql-python

the package is being installed below, although I already have Python 2.6 on the system.

/Library/Python/2.5/site-packages

How can I get pip to install in:

/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...

标签: python pip
1条回答
SAY GOODBYE
2楼-- · 2019-01-23 05:20

You should have pip-2.6. If you don't have pip version 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

Finally, you have pip version 2.6. To install mysql-python :

pip-2.6 install mysql-python
查看更多
登录 后发表回答