CentOS7.2安装Python3.6.3
一、準備工作
1.1 安裝centos7.2.1511?
1.2 下載python3.6.3 安裝包(下載地址:https://www.python.org/downloads/)
1.3 安裝依賴包:
yum -y install xz tar gcc make tk-devel wget sqlite-devel zlib-devel readline-devel openssl-devel curl-devel tk-devel gdbm-devel xz-devel bzip2-devel
1.4? 創建安裝目錄:
mkdir -p /usr/local/python3
?
二、安裝
2.1 解壓python3.6.3安裝包:
tar -zxvf Python-3.6.3.tgz
2.2?進入解壓后的目錄,編譯安裝:
# cd Python-3.6.3
# ./configure --prefix=/usr/local/python3
#?make && make install
2.3 建立python3軟連接
ln -s /usr/local/python3/bin/python3 /usr/bin/python3
2.4 修改環境變量
#?echo 'export PATH=/usr/local/python3/bin:$PATH' >> /etc/profile
# source /etc/profile
2.5 安裝完成后檢查Python3及pip3是否正常可用
# python3 -V
# pip3 -V
?
2.6 說明:CentOS系統原有python2.7.5沒有改變,仍然用python調用即可
安裝3.7.3報錯問題匯總:
# ./configure --prefix=/usr/local/python3 輸入報錯
解決:yum -y install gcc、yum -y install gcc-c++?
?
安裝好python3.7.3后無pip模塊原因
解決:yum install openssl-devel bzip2-devel expat-devel gdbm-devel readline-devel sqlite-devel libffi-devel
?轉載于:https://www.cnblogs.com/crazyjump/p/10020372.html
總結
以上是生活随笔為你收集整理的CentOS7.2安装Python3.6.3的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: softmax实现cifar10分类
- 下一篇: auth复习和BBS项目的登录(1)