推荐学习书目
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
tanteng
V2EX  ›  Python

如何在 mac 下把系统默认的 python2.7 版本切换成 3.4?

  •  
  •   tanteng ·
    tanteng · May 6, 2015 · 11574 views
    This topic created in 4050 days ago, the information mentioned may be changed or developed.


    如图,我在官网下载了最新的python 3.4版本并且安装成功,在终端输入python --version显示系统默认的python版本还是2.7,虽然输入python3就可以切换到3.4版本,但是下次打开终端实际上还是默认的python2.7,怎么在mac下切换python版本呢?

    或者说根本不需要切换?
    6 replies    2015-05-07 16:34:02 +08:00
    Sylv
        1
    Sylv  
       May 6, 2015 via iPhone   ❤️ 1
    不需要切换,要用 Python 3 就输 python3
    要知道 Python 2 和 3 不兼容,你要是把系统自带且依赖的 Python 2 改成了 3,可能会出现奇怪的问题的
    neoblackcap
        2
    neoblackcap  
       May 6, 2015
    默认python?即终端下面python命令的指向?
    直接建个符号链接到/usr/local/bin里面如何?/usr/local/bin的搜索顺序一般优先于/usr/bin,可以实现无痛替代,要换回来也简单,直接将符号链接删掉
    Delbert
        3
    Delbert  
       May 6, 2015
    善用搜索。网上一堆教程。
    除了现在没有pythonw以外,教程仍旧适用。
    Syec
        4
    Syec  
       May 6, 2015
    最好把python2和python3当作两种语言来看,不然有够受的
    staticor
        5
    staticor  
       May 6, 2015
    可以用pyenv 或 virtualenv之类的多版本管理.
    imn1
        6
    imn1  
       May 7, 2015
    虽然不懂mac,但估计换完之后很多第三方软件报废
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3000 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 38ms · UTC 14:49 · PVG 22:49 · LAX 07:49 · JFK 10:49
    ♥ Do have faith in what you're doing.