V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
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
kukat
V2EX  ›  Python

Mac 上怎么切换 python 的版本?

  •  
  •   kukat · 2011-01-11 15:24:03 +08:00 · 9560 次点击
    这是一个创建于 4851 天前的主题,其中的信息可能已经有所发展或是发生改变。
    $ ls /usr/bin/python*
    /usr/bin/python /usr/bin/python2.5-config /usr/bin/pythonw
    /usr/bin/python-config /usr/bin/python2.6 /usr/bin/pythonw2.5
    /usr/bin/python2.5 /usr/bin/python2.6-config /usr/bin/pythonw2.6

    想玩玩GAE
    用默认的2.6启动GAE HTTP 服务报错
    再GAE里指定python2.5,又没有simplejson

    easy_install 用的又是默认的python2.6版本

    有没有方便的办法切换python版本?

    P.S: 用port安装的python_select 没用
    $ sudo python_select -l
    Available versions:
    current none python26-apple
    9 条回复    1970-01-01 08:00:00 +08:00
    c
        1
    c  
       2011-01-11 15:47:00 +08:00
    Install Django

    from django.utils import simplejson
    jjgod
        2
    jjgod  
       2011-01-11 18:40:40 +08:00
    第一,用 Google 提供的 App Engine Launcher for OS X 来启动是没问题的: http://code.google.com/appengine/downloads.html#Google_App_Engine_SDK_for_Python

    第二,学会用 virtualenv。
    Livid
        3
    Livid  
    MOD
       2011-01-11 18:42:34 +08:00
    如果问题的核心是 simplejson 的话,那么安装 simplejson 的包(就几个文件)或是用 1 楼的方法就好。
    alai
        4
    alai  
       2011-01-11 20:16:58 +08:00
    那么Mac上为了GAE有装2.5的必要吗?
    ssword
        5
    ssword  
       2011-01-11 20:47:30 +08:00
    直觉py该有rvm的等价物 http://rvm.beginrescueend.com/
    est
        6
    est  
       2011-01-11 20:51:43 +08:00
    virtualenv
    nasa
        7
    nasa  
       2012-02-23 09:37:40 +08:00
    defaults write com.apple.versioner.python Version 2.6

    这个我刚刚测试可用
    jo32
        8
    jo32  
       2012-02-23 09:51:12 +08:00
    virtualenv +1 同样可以用来跑 SAE
    rebolomo
        9
    rebolomo  
       2012-02-23 12:51:21 +08:00
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2779 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 15:40 · PVG 23:40 · LAX 08:40 · JFK 11:40
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.