centos 編譯 python3.7
轉:https://www.cnblogs.com/kimyeee/p/7250560.html
1. 安裝依賴環境
# 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 libffi-devel
2.下載Python3
https://www.python.org/downloads/
1 |
|
3.安裝python3
建立目錄:
1 |
|
1 |
|
4.進入解壓後的目錄,編譯安裝。
1 2 |
|
make
1 |
|
make install
1 |
|
5.建立python3的軟鏈
1 |
|
6.並將/usr/local/python3/bin加入PATH
1 2 3 4 5 6 7 8 9 |
|
按ESC,輸入:wq回車退出。
修改完記得執行行下面的命令,讓上一步的修改生效:
1 |
|
檢查Python3及pip3是否正常可用:
1 2 3 4 |
|
7.不行的話在建立一下pip3的軟連結(我也不清楚這一步有什麼用)
1 |
|