“ssl module in Python is not available” when installing package with pip3

后端 未结 28 1468
别跟我提以往
别跟我提以往 2020-11-22 08:51

I\'ve install Python 3.4 and Python 3.6 on my local machine successfully, but am unable to install packages with pip3.

When I execute pip3 install

相关标签:
28条回答
  • 2020-11-22 09:09

    I was having the same problem for the last two days and only have fixed it right now.

    I had tried to use --trust-host option with the DigiCert_High_Assurance_EV_Root_CA.pem did not work, I couldn't install the ssl module (It tells it cannot be installed for python versions greater than 2.6), setting the $PIP_CERT variable didn't fix it either and I had libssl1.0.2 and libssl1.0.0 installed. Also worth mentioning I didn't had a ~/.pip/pip.conf file, and creating it didn't solve the bug either.

    What finally solved it, was installing python3.6 with make again. Download the Python-3.6.0.tgz from the website, run configure then make, make test and make install. Hope it works for you.

    0 讨论(0)
  • 2020-11-22 09:11

    In Ubuntu, this can help:

    cd Python-3.6.2
    ./configure --with-ssl
    make
    sudo make install
    
    0 讨论(0)
  • 2020-11-22 09:12

    If you are on Windows and use Anaconda you can try running "pip install ..." command in Anaconda Prompt instead of cmd.exe, as user willliu1995 suggests here. This was the fastest solution for me, that does not require installation of additional components.

    0 讨论(0)
  • 2020-11-22 09:13

    If you are on OSX and in case the other solutions didn't work for you (just like me).

    You can try uninstalling python3 and upgrade pip3

    brew uninstall --ignore-dependencies python3
    pip3 install --upgrade pip   
    

    This worked for me ;)

    0 讨论(0)
  • 2020-11-22 09:14

    I had a similar problem on OSX 10.11 due to installing memcached which installed python 3.7 on top of 3.6.

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

    Spent hours on unlinking openssl, reinstalling, changing paths.. and nothing helped. Changing openssl version back from to older version did the trick:

    brew switch openssl 1.0.2e
    

    I did not see this suggestion anywhere in internet. Hope it serves someone.

    0 讨论(0)
  • 2020-11-22 09:15

    If you are on Windows and use anaconda this worked for me:

    I tried a lot of other solutions which did not work (Environment PATH Variable changes ...)

    The problem can be caused by DLLs in the Windows\System32 folder (e.g. libcrypto-1_1-x64.dll or libssl-1_1-x64.dll or others) placed there by other software.

    The fix was installing openSSL from https://slproweb.com/products/Win32OpenSSL.html which replaces the dlls by more recent versions.

    0 讨论(0)
提交回复
热议问题