[转]Ubuntu安装Python3.6 Ubuntu安装Python3.6

python

 

Ubuntu默认安装了Python2.7和3.5

输入命令python

按Ctrl+D退出python命令行

输入命令sudo add-apt-repository ppa:jonathonf/python-3.6

按Enter确认

输入命令sudo apt-get update

输入命令sudo apt-get install python3.6

按Y确认

调整Python3的优先级,使得3.6优先级较高

sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.5 1

sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.6 2

更改默认值,python默认为Python2,现在修改为Python3

sudo update-alternatives --install /usr/bin/python python /usr/bin/python2 100

sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 150

此时再输入命令python

可以看到已经是Python3.6了!

输入命令sudo apt-get install python3-pip安装pip

输入命令sudo pip3 install --upgrade pip更新pip

 在3.6后,pip3的使用方法

On Unix-like systems use:

python3.6 -m pip install [Package_to_install]

添加Selenum模块

sudo -H pip install selenium

添加Appium模块

sudo -H pip install Appium-Python-Client

 

Linux

Ubuntu默认安装了Python2.7和3.5

输入命令python

按Ctrl+D退出python命令行

输入命令sudo add-apt-repository ppa:jonathonf/python-3.6

按Enter确认

输入命令sudo apt-get update

输入命令sudo apt-get install python3.6

按Y确认

调整Python3的优先级,使得3.6优先级较高

sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.5 1

sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.6 2

更改默认值,python默认为Python2,现在修改为Python3

sudo update-alternatives --install /usr/bin/python python /usr/bin/python2 100

sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 150

此时再输入命令python

可以看到已经是Python3.6了!

输入命令sudo apt-get install python3-pip安装pip

输入命令sudo pip3 install --upgrade pip更新pip

 在3.6后,pip3的使用方法

On Unix-like systems use:

python3.6 -m pip install [Package_to_install]

添加Selenum模块

sudo -H pip install selenium

添加Appium模块

sudo -H pip install Appium-Python-Client

以上是 [转]Ubuntu安装Python3.6 Ubuntu安装Python3.6 的全部内容, 来源链接: utcz.com/z/386963.html

回到顶部