更改Ubuntu默认Python版本方法

Anaconda使用pip安装的第三方包

方法1:将安装到python2.7下面的pygal和pygal-2.4.0.dist-info拷贝到anaconda的/anaconda3/lib/python3.6/site-packages路径下。
方法2:利用如下方法将库安装到anaconda目录下;sudo /~/~/anaconda3/bin/pip install ** (pygal替换为需要安装的包)

 

更改Ubuntu默认Python版本方法

https://www.jianshu.com/p/9d3033d1b26f

一般Ubuntu默认的Python版本都为2.x, 如何改变Python的默认版本呢?假设我们需要把Python3.5设置为默认版本:
首先查看Python默认版本:

ubuntu@user~$:python --version
Python 2.7

搜索系统是否已经安装Python3.5:

ubuntu@user~$:whereis python3.5

如果结果里有/usr/bin/python3.5说明已经安装,如果没有则需要手动安装。

安装完成后,需要删除原有的Python连接文件:

ubuntu@user~:rm /user/bin/python

然后建立指向Python3.5的软连接:

ubuntu@user~:ln -s /usr/bin/python3.5 /usr/bin/python

之后把路径/usr/bin/加入环境变量PATH中:

ubuntu@user~:PATH=/usr/bin:$PATH

现在输入python --version你就会发现python默认版本变为Python3.5了:)



链接:https://www.jianshu.com/p/9d3033d1b26f
 

 

你可能感兴趣的:(Ubuntu)