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

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