編譯安裝Python3

安裝依賴

yum install -y ncurses-libs zlib-devel mysql-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel

發現的問題:若是不安裝readline-,python解釋器沒法使用上下左右箭頭; 不安裝openssl-, pip沒法使用,不安裝zlib-devel,編譯沒法經過。其餘問題待發現後再補充。python

下載安裝包

wget https://www.python.org/ftp/python/3.6.7/Python-3.6.7.tar.xzmysql

這裏以root身份運行如下命令:linux

tar xf Python-3.6.7.tar.xz
cd Python-3.6.7
./configure && echo ok
make && make install && echo ok

安裝後驗證

執行sql

Python 3.6.7 (default, Dec 17 2018, 22:06:24)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-36)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
>>>
[root@t ~]# pip3 list
Package    Version
---------- -------
pip        18.1
setuptools 39.0.1
相關文章
相關標籤/搜索