推荐学习书目
› Learn Python the Hard Way
Python Sites
› PyPI - Python Package Index
› http://diveintopython.org/toc/index.html
› Pocoo
值得关注的项目
› PyPy
› Celery
› Jinja2
› Read the Docs
› gevent
› pyenv
› virtualenv
› Stackless Python
› Beautiful Soup
› 结巴中文分词
› Green Unicorn
› Sentry
› Shovel
› Pyflakes
› pytest
Python 编程
› pep8 Checker
Styles
› PEP 8
› Google Python Style Guide
› Code Style from The Hitchhiker's Guide
puyaraimondii
V2EX  ›  Python

关于 pip 默认指向的 Python 版本

  •  
  •   puyaraimondii · Mar 9, 2017 · 3850 views
    This topic created in 3529 days ago, the information mentioned may be changed or developed.
    想在 python2.7 中安装一个 tensorflow 的包,然而发现最近输入 pip ,会直接把这个包安装到 python3 中

    请问如何把 pip 默认的 python 版本改到 python2.7 里面啊?

    小白求助
    6 replies  •  2017-03-10 09:54:40 +08:00
    Patrick95
    Patrick95
    Mar 9, 2017
    1
    Python 2.7 -> pip2 install
    Python 3 -> pip3 install
    knightdf
    knightdf
    Mar 9, 2017
    2
    vim `which pip` -> 修改第一行指向的 python
    puyaraimondii
    puyaraimondii
    OP
    Mar 9, 2017
    3
    @knightdf 忘记说了,我用的不是 vim ,是直接在 terminal 上运行的。。。
    puyaraimondii
    puyaraimondii
    OP
    Mar 9, 2017
    4
    @Patrick95 @knightdf 感谢两位的帮助,不知为何现在又恢复正常了。。。解决方案:把 terminal 关掉,再打开,重复两次就又恢复回去了。。。。感觉这个问题可能和我尝试了一下 sudo easy_install -U pip 有关。。。虽然还是不懂为什么。。。。
    ynyounuo
    ynyounuo
    Mar 9, 2017
    5
    @puyaraimondii ... 你大概没理解意思
    pip 本身就是个 python script 然后给了 x 权限而已
    ox0spy
    ox0spy
    Mar 10, 2017
    6
    $ pip -V # 看看使用的 pip 对不对

    $ pip show <installed-package> # 看看 Location 字段的值
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1966 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 03:44 · PVG 11:44 · LAX 19:44 · JFK 22:44
    ♥ Do have faith in what you're doing.