Centos7安装python3和pip3
安装相关依赖
yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel
开始安装
cd /opt wget http://npm.taobao.org/mirrors/python/3.7.9/Python-3.7.9.tgz tar -xzf Python-3.7.9.tgz cd Python-3.7.9 ./configure --prefix=/opt/python make && make install cat << EOF >> /etc/profile # python export PYTHON=/opt/python/bin export PATH=\$PATH:\$PYTHON EOF source /etc/profile # 升级pip pip3 install --upgrade pip
# 查看已安装的包 pip3 freeze pip3 list # 检查哪些包需要更新 pip3 list outdated