阿里云 CentOS7.4 安裝 Python3.6的方法講解
1、到python官網(wǎng) https://www.python.org 查找最新的原碼,我使用的,Python-3.6.3
2、mkdir /home/soft
創(chuàng)建軟件管理目錄、
3、cd /home/soft/
進(jìn)入soft目錄,因為我下一步是下載python的源碼
4、wget https://www.python.org/ftp/python/3.6.3/Python-3.6.3.tgz
下載Python-3.6.3的源碼到/home/soft/里,如果沒有安裝wget 請執(zhí)行下面的命令,
yum -y install wget
安裝wget
5、tar -xzvf Python-3.6.3.tgz -C /Python-3.6
解壓到 /home/soft/Python-3.6
6、vim /home/soft/Python-3.6/Modules/Setup
安裝ssl,如果要使用pip的話,最好安裝ssl
#修改結(jié)果如下: # Socket module helper for socket(2) _socket socketmodule.c timemodule.c # Socket module helper for SSL support; you must comment out the other # socket line above, and possibly edit the SSL variable: #SSL=/usr/local/ssl _ssl _ssl.c \ -DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl \ -L$(SSL)/lib -lssl -lcrypto
7、./configure --prefix=/usr/local/
我們打算把python3.6安裝到目錄 /usr/local/
源碼的安裝一般由3個步驟組成:配置(configure)、編譯(make)、安裝(make install)
8、make
9、make install
ython3.6程序的執(zhí)行文件:/usr/local/bin/python3.6
python3.6應(yīng)用程序目錄:/usr/local/lib/python3.6
pip3的執(zhí)行文件:/usr/local/bin/pip3.6
pyenv3的執(zhí)行文件:/usr/local/bin/pyenv-3.6
更改/usr/bin/python鏈接
# cd/usr/bin # mv python python.backup # ln -s /usr/local/bin/python3.6 /usr/bin/python # ln -s /usr/local/bin/python3.6 /usr/bin/python3
更改yum腳本的python依賴
# cd /usr/bin # ls yum* yum yum-config-manager yum-debug-restore yum-groups-manager yum-builddep yum-debug-dump yumdownloader
更改以上文件頭為
#!/usr/bin/python 改為 #!/usr/bin/python2
修改gnome-tweak-tool配置文件
# vi /usr/bin/gnome-tweak-tool #!/usr/bin/python 改為 #!/usr/bin/python2
修改urlgrabber配置文件
# vi /usr/libexec/urlgrabber-ext-down #!/usr/bin/python 改為 #!/usr/bin/python2
以上這篇阿里云 CentOS7.4 安裝 Python3.6的方法講解就是小編分享給大家的全部內(nèi)容了,希望能給大家一個參考,也希望大家多多支持腳本之家。
相關(guān)文章
詳解基于Centos7+Nginx+Tomcat8的負(fù)載均衡服務(wù)器的搭建
這篇文章主要介紹了詳解基于Centos7+Nginx+Tomcat8的負(fù)載均衡服務(wù)器的搭建,具有一定的參考價值,感興趣的小伙伴們可以參考一下2017-06-06
在Linux中如何列出和刪除Iptables防火墻規(guī)則
當(dāng)涉及到網(wǎng)絡(luò)安全時,防火墻是一個至關(guān)重要的組成部分,Iptables是一種常用的防火墻解決方案,可以幫助管理員保護(hù)他們的系統(tǒng)免受惡意攻擊,本文將詳細(xì)介紹如何列出和刪除Iptables防火墻規(guī)則,以幫助您更好地管理系統(tǒng)的安全性2023-06-06
linux網(wǎng)絡(luò)知識詳解:iptables 規(guī)則介紹
這篇文章主要介紹了linux網(wǎng)絡(luò)知識詳解:iptables 規(guī)則介紹,需要的朋友可以參考下2024-02-02

