編譯安裝全是坑……
第一遍裝完無法使用pip,報錯找不到ssl模塊。各種報錯:
pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
。。。
configure: error: Invalid --with-openssl value
。。。
結(jié)果各種搗鼓。
1、注意cetos6.5自帶的openssl版本是1.0.1,需要升級到1.0.2,升級完之后用openssl version檢查一下;
2、提前安裝好各種依賴包。yum install openssl-devel bzip2-devel expat-devel gdbm-devel readline-devel sqlite-devel gcc gcc-c++ libffi-devel
3、./configure --prefix=/usr/local/python 之后,需要進到Modules里,修改Setup如下(一般升級完openssl,openssl默認(rèn)就在/usr/local/ssl文件夾了):
# Socket module helper for socket(2)_socket socketmodule.c# Socket module helper for SSL support; you must comment out the other# socket line above, and possibly edit the SSL variable:SSL=/usr/local/ssl_ssl _ssl.c / -DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl / -L$(SSL)/lib -lssl -lcrypto
把這5行的注釋去掉。再進行make && make install,應(yīng)該就能成功了。如果以前編譯失敗,記得把原來的Makefile文件刪除掉。
總結(jié)
以上就是這篇文章的全部內(nèi)容了,希望本文的內(nèi)容對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,謝謝大家對武林站長站的支持。如果你想了解更多相關(guān)內(nèi)容請查看下面相關(guān)鏈接
新聞熱點
疑難解答