推荐学习书目
› 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 · 17594 views
    This topic created in 4355 days ago, the information mentioned may be changed or developed.
    如果分开两个目录安装,那是不是没有什么互相干扰的一回事?
    如果是这样,Django等其他库使用有没有影响?
    如果不能同时存在,有木有什么解决方案。

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

    还是要 谢谢你。
    clino
    clino
    Dec 17, 2014
    3
    可以用 virtualenv 配置不同的 python 版本下的环境
    scratbai
    scratbai
    Dec 17, 2014
    4
    我就装了两个,python3我就在bin下建个叫python3的链接。可以分别使用python和python3
    messyidea
    messyidea
    Dec 17, 2014 via Android
    5
    环境变量配好就行了
    xarrow
    xarrow
    Dec 17, 2014
    6
    应该那个环境变量优先选择 P2还是P3了
    vJianZhen
    vJianZhen
    OP
    Dec 17, 2014
    7
    @xarrow 缘分呐!头像一样的银儿
    egrcc
    egrcc
    Dec 17, 2014 via Android
    8
    不会,我的ubuntu就装了两个,没有问题
    Rand01ph
    Rand01ph
    Dec 17, 2014
    9
    编译的时候指定到/usr/local目录,使用时用python2.x和python3.x作为启动指令。
    cha1
    cha1
    Dec 17, 2014
    10
    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
    Delbert
    Dec 17, 2014
    11
    我Mac装的3.4.1,自带的2.7.6
    我Win装的3.4.2,还有个2.7.8
    都正常使用,没有任何问题。
    totogo
    totogo
    Dec 17, 2014
    12
    @vJianZhen
    @xarrow
    在一起!在一起!
    vJianZhen
    vJianZhen
    OP
    Dec 18, 2014
    13
    @totogo 叫我说啥好呢
    yuankui
    yuankui
    Dec 18, 2014
    14
    知错能改,善莫大焉。。
    maxbon
    maxbon
    Dec 18, 2014
    15
    不会冲突
    vJianZhen
    vJianZhen
    OP
    Dec 18, 2014
    16
    谢谢V友们,亲亲~
    lao454490095
    lao454490095
    Dec 20, 2014❤️1
    17
    github搜pyenv
    forLearn
    forLearn
    Apr 28, 2016
    18
    @Delbert 在 windows 上应该怎么配置环境变量以共存呢?
    Delbert
    Delbert
    May 1, 2016 via Android
    19
    @forLearn 常用哪个就把哪个放在前面
    forLearn
    forLearn
    May 4, 2016❤️1
    20
    关于共存我弄好了,我想了想还是说说吧。
    将两个文件夹都放到环境变量中,同时不要用 PYTHONHOME 这个变量值。最后,我把 python3.4 的文件夹中的 python.exe 重命名为 python3.exe 了,这样在命令行可以直接以 python 与 python3 分别调用。
    也感谢 @Delbert 的回复。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1354 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 42ms · UTC 23:59 · PVG 07:59 · LAX 15:59 · JFK 18:59
    ♥ Do have faith in what you're doing.