【问题标题】:easy_install gets wrong pip versioneasy_install 得到错误的 pip 版本
【发布时间】:2012-06-20 06:58:59
【问题描述】:

我一直按照http://docs.python-guide.org/en/latest/starting/install/osx/ 上的说明进行操作,但由于某种原因,这并没有像我预期的那样进行。

我默认运行 python 2.7,但必须按照以下说明更新 easy_install:https://superuser.com/questions/256717/easy-install-the-wrong-version-of-python-modules-mac-os 并将其从 /usr/local/bin/share 链接到 /usr/local/bin。它似乎工作正常。

问题是,现在当我安装 pip 时,它似乎安装到 2.6 而不是 2.7。

    darky:~ user$ easy_install --upgrade pip
    Searching for pip
    Reading http://pypi.python.org/simple/pip/
    Reading http://pip.openplans.org
    Reading http://www.pip-installer.org
    Best match: pip 1.1
    Processing pip-1.1-py2.6.egg
    pip 1.1 is already the active version in easy-install.pth
    Installing pip script to /usr/local/bin
    Installing pip-2.6 script to /usr/local/bin

    Using /Library/Python/2.6/site-packages/pip-1.1-py2.6.egg
    Processing dependencies for pip
    Finished processing dependencies for pip

在 MartijnPieters 的 cmets 之后,这个问题不再仍然存在

    darky:~ user$ /usr/local/share/python/easy_install-2.7 pip
    Searching for pip
    Best match: pip 1.1
    Processing pip-1.1-py2.7.egg
    pip 1.1 is already the active version in easy-install.pth
    Installing pip script to /usr/local/share/python
    Installing pip-2.7 script to /usr/local/share/python
    Using /usr/local/lib/python2.7/site-packages/pip-1.1-py2.7.egg
    Processing dependencies for pip
    Finished processing dependencies for pip
    darky:~ user$ pip install virtualenv --upgrade
    Requirement already up-to-date: virtualenv in /Library/Python/2.6/site-packages
    Cleaning up...

但是 pip 仍然使用 python-2.6 创建环境。所以我必须将它指向正确的 pyhton 解释器。

    darky:pytravisci pedrorodrigues$ virtualenv --python=/usr/local/bin/python2.7 ENV
    Running virtualenv with interpreter /usr/local/bin/python2.7
    New python executable in ENV/bin/python
    Installing setuptools............................done.
    Installing pip...............done.

【问题讨论】:

标签: python python-2.7 virtualenv pip setuptools


【解决方案1】:

你可以使用

easy_install-2.7

或者如果您没有该别名:

python2.7 -m easy_install <stuff>

对于点子:

pip2.7

【讨论】:

    猜你喜欢
    • 2013-06-04
    • 1970-01-01
    • 2023-03-12
    • 2014-08-21
    • 2015-01-13
    • 1970-01-01
    • 2012-10-23
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多