同一台机器同时安装 python2.7 和 python3.4 会不会冲突呀? - V2EX
V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
推荐学习书目
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
结巴中文分词
Gren Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
vJianZhen

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

  •  
  •   vJianZhen Dec 17, 2014 17074 views
    This topic created in 4152 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     2493 Online   Highest 6679       Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 48ms UTC 02:01 PVG 10:01 LAX 19:01 JFK 22:01
    Do have faith in what you're doing.
    ubao msn snddm index pchome yahoo rakuten mypaper meadowduck bidyahoo youbao zxmzxm asda bnvcg cvbfg dfscv mmhjk xxddc yybgb zznbn ccubao uaitu acv GXCV ET GDG YH FG BCVB FJFH CBRE CBC GDG ET54 WRWR RWER WREW WRWER RWER SDG EW SF DSFSF fbbs ubao fhd dfg ewr dg df ewwr ewwr et ruyut utut dfg fgd gdfgt etg dfgt dfgd ert4 gd fgg wr 235 wer3 we vsdf sdf gdf ert xcv sdf rwer hfd dfg cvb rwf afb dfh jgh bmn lgh rty gfds cxv xcv xcs vdas fdf fgd cv sdf tert sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf shasha9178 shasha9178 shasha9178 shasha9178 shasha9178 liflif2 liflif2 liflif2 liflif2 liflif2 liblib3 liblib3 liblib3 liblib3 liblib3 zhazha444 zhazha444 zhazha444 zhazha444 zhazha444 dende5 dende denden denden2 denden21 fenfen9 fenf619 fen619 fenfe9 fe619 sdf sdf sdf sdf sdf zhazh90 zhazh0 zhaa50 zha90 zh590 zho zhoz zhozh zhozho zhozho2 lislis lls95 lili95 lils5 liss9 sdf0ty987 sdft876 sdft9876 sdf09876 sd0t9876 sdf0ty98 sdf0976 sdf0ty986 sdf0ty96 sdf0t76 sdf0876 df0ty98 sf0t876 sd0ty76 sdy76 sdf76 sdf0t76 sdf0ty9 sdf0ty98 sdf0ty987 sdf0ty98 sdf6676 sdf876 sd876 sd876 sdf6 sdf6 sdf9876 sdf0t sdf06 sdf0ty9776 sdf0ty9776 sdf0ty76 sdf8876 sdf0t sd6 sdf06 s688876 sd688 sdf86