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

同一台机器同时安装 python2.7 和 python3.4 会不会冲突呀?

  •  
  •   vJianZhen · Dec 17, 2014 · 17120 views
    This topic created in 4165 days ago, the information mentioned may be changed or developed.
    如果分开两个目录安装,那是不是没有什么互相干扰的一回事?
    如果是这样,Django等其他库使用有没有影响?
    如果不能同时存在,有木有什么解决方案。

    求解。
    20 replies    2016-05-04 14:44:48 +08:00
    wxg4net
        1
    wxg4net  
       Dec 17, 2014
    一般是可以同时安装的
    vJianZhen
        2
    vJianZhen  
    OP
       Dec 17, 2014
    @wxg4net 唉,我不应该问这个问题的。其实,Google一下已经很容易就找到了答案。

    还是要 谢谢你。
    clino
        3
    clino  
       Dec 17, 2014
    可以用 virtualenv 配置不同的 python 版本下的环境
    scratbai
        4
    scratbai  
       Dec 17, 2014
    我就装了两个,python3我就在bin下建个叫python3的链接。可以分别使用python和python3
    messyidea
        5
    messyidea  
       Dec 17, 2014 via Android
    环境变量配好就行了
    xarrow
        6
    xarrow  
       Dec 17, 2014
    应该那个环境变量优先选择 P2还是P3了
    vJianZhen
        7
    vJianZhen  
    OP
       Dec 17, 2014
    @xarrow 缘分呐!头像一样的银儿
    egrcc
        8
    egrcc  
       Dec 17, 2014 via Android
    不会,我的ubuntu就装了两个,没有问题
    Rand01ph
        9
    Rand01ph  
       Dec 17, 2014
    编译的时候指定到/usr/local目录,使用时用python2.x和python3.x作为启动指令。
    cha1
        10
    cha1  
       Dec 17, 2014
    zsh的输出结果:
    ➜ ~ python --version
    Python 2.7.6
    ➜ ~ python3.4 --version
    Python 3.4.0
    ➜ ~ uname -a
    Linux Aspire 3.13.0-43-generic #72-Ubuntu SMP Mon Dec 8 19:35:06 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

    我机子也是两个版本的Python呢。
    Delbert
        11
    Delbert  
       Dec 17, 2014
    我Mac装的3.4.1,自带的2.7.6
    我Win装的3.4.2,还有个2.7.8
    都正常使用,没有任何问题。
    totogo
        12
    totogo  
       Dec 17, 2014
    @vJianZhen
    @xarrow
    在一起!在一起!
    vJianZhen
        13
    vJianZhen  
    OP
       Dec 18, 2014
    @totogo 叫我说啥好呢
    yuankui
        14
    yuankui  
       Dec 18, 2014
    知错能改,善莫大焉。。
    maxbon
        15
    maxbon  
       Dec 18, 2014
    不会冲突
    vJianZhen
        16
    vJianZhen  
    OP
       Dec 18, 2014
    谢谢V友们,亲亲~
    lao454490095
        17
    lao454490095  
       Dec 20, 2014   ❤️ 1
    github搜pyenv
    forLearn
        18
    forLearn  
       Apr 28, 2016
    @Delbert 在 windows 上应该怎么配置环境变量以共存呢?
    Delbert
        19
    Delbert  
       May 1, 2016 via Android
    @forLearn 常用哪个就把哪个放在前面
    forLearn
        20
    forLearn  
       May 4, 2016   ❤️ 1
    关于共存我弄好了,我想了想还是说说吧。
    将两个文件夹都放到环境变量中,同时不要用 PYTHONHOME 这个变量值。最后,我把 python3.4 的文件夹中的 python.exe 重命名为 python3.exe 了,这样在命令行可以直接以 python 与 python3 分别调用。
    也感谢 @Delbert 的回复。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3434 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 59ms · UTC 11:03 · PVG 19:03 · LAX 04:03 · JFK 07:03
    ♥ Do have faith in what you're doing.