問題解決: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.


問題描述:執行pip install pykafka命令時出現

pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Collecting pykafka
  Could not fetch URL https://pypi.python.org/simple/pykafka/: There was a problem confirming the ssl certificate: Can't connect to HTTPS URL because the SSL module is not available. - skipping
  Could not find a version that satisfies the requirement pykafka (from versions: )
No matching distribution found for pykafka

 問題解決:

在./configure過程中,如果沒有加上–with-ssl參數時,默認安裝的軟件涉及到ssl的功能不可用,
剛好pip3過程需要ssl模塊,而由於沒有指定,所以該功能不可用。

查看openssl安裝包,發現缺少openssl-devel包 

    1. 查看openssl安裝包,發現缺少openssl-devel包 
      [root@localhost ~]# rpm -aq|grep openssl 
      openssl-0.9.8e-20.el5 
      openssl-0.9.8e-20.el5 
      [root@localhost ~]#

    2. yum安裝openssl-devel 
      [root@localhost ~]# yum install openssl-devel -y 
      查看安裝結果 
      [root@localhost ~]# rpm -aq|grep openssl 
      openssl-0.9.8e-26.el5_9.1 
      openssl-0.9.8e-26.el5_9.1 
      openssl-devel-0.9.8e-26.el5_9.1 
      openssl-devel-0.9.8e-26.el5_9.1

    3. 重新對python3.6進行編譯安裝,用一下過程來實現編譯安裝:

      cd Python-3.6.4
      ./configure --with-ssl
      make
      sudo make install

重新運行pip install pykafka時,又出現此提示;

You are using pip version 9.0.1, however version 19.2.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

運行

pip install --upgrade pip


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM