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 https://www.python.org/ftp/python/3.6.8/Python-3.6.8.tgz tar -xvf Python-3.6.8.tgz mv Python-3.6.8 python-3.6.8# 在local目录下创建python3目录 mkdir /opt/python3 # 配置安装目录 cd /opt/python-3.6.8 ./configure --prefix=/opt/python3 # 编译安装 make && make install # 配置python3软连接 ln -s /opt/python3/bin/python3 /usr/bin/python3 # 配置pip3软连接 ln -s /opt/python3/bin/pip3 /usr/bin/pip3 # 升级pip pip3 install --upgrade pip
# 查看已安装的包
pip3 freeze
pip3 list
# 检查哪些包需要更新
pip3 list outdated

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM