yum安裝python3
yum install epel-release -y
yum install https://centos7.iuscommunity.org/ius-release.rpm -y
yum install python36 u -y
ln -s /bin/python3.6 /bin/python3 #創建python3的連接符
編譯安裝python3
https://www.python.org/ftp/python/3.6.8/Python-3.6.8.tgz
2.製作安裝文件
mkdir python3.6
cd python3.6
pwd
3.解壓到當前文件
tar -zxvf Python-3.6.8.tgz
4../configure
5.make
6.安裝
make install 或者 sudo make install 成功!
編譯安裝python3
cd Python-3.6.8
解決pip3不能使用,安裝時添加--with--ssl
./configure --with-ssl
make
sudo make install
安裝pip3
1.首先找到pip3的位置(在python3.6的安裝包內)
cd /usr/local/bin
ls (這裏可以看見pip3.6的文件了)
ln -s /usr/local/bin/pip3.6 /bin/pip3 #創建pip3命令的連接符
pip3 -v
完成!
卸載python3
rpm -qa|grep python3|xargs rpm -ev --allmatches --nodeps 卸載pyhton3
whereis python3 |xargs rm -frv 刪除所有殘餘文件
成功卸載!
whereis python 查看現有安裝的python
轉自:https://blog.csdn.net/lcanlup/article/details/84635625
簡單安裝如下(不推薦)
1.安裝 epel-release擴展yum源
yum install -y epel-release
yum clean all
yum makecache
2.安裝setuptools
yum install -y python36-setuptools
3.安裝pip3
easy_install-3.6 pip
-------------
參考原文:https://blog.csdn.net/lpwmm/article/details/80160728
源碼安裝請參考簡書:https://www.jianshu.com/p/758b592387d1