ubuntu 16.04 安装 python3.6
-
ubuntu16.04默认安装了python2.7和python3.5, 相关依赖已经安装,若没有则
sudo apt-get install openssl
sudo apt-get install libssl-dev
sudo apt-get install libc6-dev gcc
sudo apt-get install -y make build-essential zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm tk-dev
-
导入第三方软件库
sudo add-apt-repository ppa:jonathonf/python-3.6
可能会出现add-apt-repository commod not found
只需sudo apt-get install software-properties-common python-software-properties
-
更新软件源并安装
sudo apt-get update
sudo apt-get install python3.6
-
将默认的python 链接指向python3.6
sudo rm python
// (切换到/usr/bin 目录下)需要把原本存在的Python链接删去,重新建立软链接至python 3.6
sudo ln -s python3.6 /usr/bin/python
安装pip
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python get-pip.py
网友评论