- cd 到/tmp目錄下
- wget https://www.python.org/ftp/python/3.6.6/Python-3.6.6.tgz ##下載包
- tar -xzvf Python-3.6.6.tgz -C /tmp ##解壓
- cd Python-3.6.6/ ##進入
- ./configure --prefix=/usr/local
- make
- make altinstall
- ln -s /usr/local/bin/python3.6 /usr/bin/python3 ##Python建立軟連接
- ln -s /usr/local/bin/pip3.6 /usr/bin/pip ##pip建立軟連接
例外處理:
錯誤一:configure: error: in `Python-3.6.5': configure: error: no a ### 缺少依賴包
可能用到的依賴包報上面的錯運行一下下面的命令就好了
yum install openssl-devel bzip2-devel expat-devel gdbm-devel readline-devel sqlite-devel
錯誤二:zipimport.ZipImportError: can't decompress data; zlib not available
make: *** [altinstall] Error 1
解決:yum -y install zlib* 稍后繼續執行
錯誤三:
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details
這個錯是缺少GCC軟體套件
執行:yum install gcc 安裝一下gcc套件就好了
轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/223778.html
標籤:其他
上一篇:NetAnim 安裝避雷提示
下一篇:樹莓派4B搭建寶塔Linux面板
