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
Logo

CSDN联合极客时间,共同打造面向开发者的精品内容学习社区,助力成长!

更多推荐