在centos7 中安裝Python3中遇到的問題
wget https://www.python.org/ftp/python/3.6.4/Python-3.6.4.tgz
tar -xvf Python-3.6.4.tgz
cd Python-3.6.4
./configure
報錯:
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details
解決辦法:安裝GCC
yum install gcc
完成后再次安裝
- ./configure
- make
- make altinstall
在make install 命令后出現錯誤:
zipimport.ZipImportError: can't decompress data; zlib not available
make: *** [install] Error 1
解決方法:
yum install -y zlib*
- cd Modules/zlib
- ./configure
- make install
- cd -
- make install
如果安裝完成后pip3 出現:
pip is configured with locations that require TLS/SSL
安裝openssl &
openssl-devel
yum -y install openssl
yum -y install openssl-devel
重新安裝Python3
- ./configure --with-ssl
- make
- sudo make install