请问如何将linux下的python选择默认为python3
Tofloor
poster avatar
zhiweitai
deepin
2013-11-19 21:17
Author
如题,首先不知道这个问题是不是在这里。想让python3默认为系统版本不想用python2.7
我是这样做的不知道对不对。
        which python找到 /usr/bin/python
        sudo rm /usr/bin/python
        然后找到python3做一个软连接
       sudo ln -s /usr/bin/python3 /usr/bin/python

        这样操作后python在终端下却是是python3的版本了,但是问题来了,如果我需要安装一些相关插件的话如:sudo apt-get install python3-setuptools。
        这样好像还没问题,但是easy_install3 以及pip-3.3这样的一些设置是不是也需要通过上述的rm在ln -s方式去建立关联呢?
        我试验了一下通过 sudo pip install django 然后pip freeze 以及pip-3.3 freeze竟然都出现了安装完的django1.6这样不明白的问题就是pip到底对应的是python2.7的版本还是python3.3的呢? :?:
        发现deepin很多东西好像绑定是python2.7经过修改后python3.3发现 ctl+alt+t终端等操作不好用了,改回python2.7就好用了....
Reply Favorite View the author
All Replies
cxbii
deepin
2013-11-20 18:12
#1
你应该谷歌搜索 设置系统默认python 版本

然后可以得到个比较靠谱的结果:
http://forum.ubuntu.org.cn/viewtopic.php?f=63&t=378384

声明:我啥都不会。。。
Reply View the author
BingoLove
deepin
2013-11-20 18:21
#2
是什么让你产生了用3换2的想法的
Reply View the author
musmuhe
deepin
2013-11-21 03:09
#3
linuxdeepin是否有类似python-updater的命令,软链python之后就执行一下
Reply View the author