一、python的安装
1 、python的安装
If you quickly want to get the latest version of Python installed on Ubuntu and get future updates automatically, then you can install it from the below third-party PPA repository…
To do that, run the commands below to add the PPA.
First install Ubuntu software properties package if it’s not already installed on your system..
sudo apt update
sudo apt install software-properties-common
After that run the commands to add the PPA..
sudo add-apt-repository ppa:deadsnakes/ppa
Finally, run the commands below to install Python 3.7
sudo apt update
sudo apt install python3.7
2、建立python3指向python3.7
先执行查看版本,如果有则证明软链接已存在,需要先删去以前的再重新建立
cd /usr/bin
ls -l | grep python
已有python3的软链接指向的是python3.5,而没有pip3的软链接所以需要删除python3的软链接重新建立
删除指向python3.5的软连接
sudo rm -rf /usr/bin/python3
建立指向python3.7的软连接
sudo ln -s /usr/bin/python3.7 /usr/bin/python3
检验python3的指向
python3 –version
3、安装 pip3
sudo apt-get install python3-pip
添加 pip3 的软链接
sudo ln -s /usr/local/python3/bin/pip3.7 /usr/bin/pip3