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

后端 未结 28 1481
别跟我提以往
别跟我提以往 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:19

    If you are on OSX and have compiled python from source:

    Install openssl using brew brew install openssl

    Make sure to follow the instructions brew gives you about setting your CPPFLAGS and LDFLAGS. In my case I am using the openssl@1.1 brew formula and I need these 3 settings for the python build process to correctly link to my SSL library:

    export LDFLAGS="-L/usr/local/opt/openssl@1.1/lib"
    export CPPFLAGS="-I/usr/local/opt/openssl@1.1/include"
    export PKG_CONFIG_PATH="/usr/local/opt/openssl@1.1/lib/pkgconfig"
    

    Assuming the library is installed at that location.

提交回复
热议问题