本來測試安裝 Python3.8.2,但很3.8.2無法安裝 Pandas,因此退而求其次選擇 3.7.7
由於未安裝compile工具,從此開始安裝
yum groupinstall "Development tools"
yum 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
*** 接著一定要記著先裝好 openssl ,否則 pip 不能用,又要重新 build
wget https://www.openssl.org/source/openssl-1.1.1e.tar.gz
tar -xzf openssl-1.1.1e.tar.gz
cd openssl-1.1.1e
./config --prefix=/usr/local/openssl no-zlib
make
make install
放置openssl lib
mv /usr/bin/openssl /usr/bin/openssl.bak
mv /usr/include/openssl/ /usr/include/openssl.bak
ln -s /usr/local/openssl/include/openssl /usr/include/openssl
ln -s /usr/local/openssl/bin/openssl /usr/bin/openssl
echo /usr/local/lib >> /etc/ld.so.conf.d/openssl.conf
下載Python 及解壓縮
wget --no-check-certificate https://www.python.org/ftp/python/3.7.7/Python-3.7.7.tgz
tar -xzvf Python-3.7.7.tgz
cd Python-3.7.7
安裝。
./configure --with-openssl=/usr/local/openssl/
make
make install
安裝完畢,執行檔位於 /usr/local/bin 下面, python3 & pip3
沒有留言:
張貼留言