centos7安装python3.7.4_Centos7升级Python3.7.4
和大家技術分享一下當我們安裝完成Centos7后,默認系統Python的版本為2.7.5。我們希望將Python升級到最新版本。
1、安裝依賴項
yum install -y openssl-devel openssl-static zlib-devel lzma tk-devel xz-devel bzip2-devel ncurses-devel gdbm-devel readline-devel sqlite-devel gcc libffi-devel
Python最新版
3、創建Download目錄
Mkdir /usr/Downloads
Cd /usr/Downloads
Wget https://www.python.org/ftp/python/3.7.4/Python-3.7.4.tgz
3.1、如果wget沒有安裝的話會提示“-bash: Wget: command not found”,安裝wget即可
yum install wget -y
4、將下載下來的壓縮包進行解壓
tar -xzvf Python-3.7.4.tgz
5、將解壓后的文件移動到/usr/local路徑下
mv Python-3.7.4 /usr/local
6、進入到Python目錄下進行編譯安裝
./configure
make && make install
7、移動Python路徑并修改軟鏈接
mv /usr/bin/python /usr/bin/python3.7.4
ln -s /usr/local/Python-3.7.4/python /usr/bin/python
8、輸入python回車后,我們會發現版本已經升級到最新了
[root@localhost /]# python
Python 3.7.4 (default, Aug 14 2019, 15:11:59)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-36)] on linux
Type "help", "copyright", "credits" or "license" for more information.
此文章為原創文章,作者:胖哥叨逼叨,如若轉載,請與我聯系并注明出處:https://www.pangshare.com/1656.htm
創作挑戰賽新人創作獎勵來咯,堅持創作打卡瓜分現金大獎總結
以上是生活随笔為你收集整理的centos7安装python3.7.4_Centos7升级Python3.7.4的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: oracle dblink 验证,Ora
- 下一篇: python collections模块