ImportError: cannot import name HTTPSHandler using PIP

后端 未结 12 1871
刺人心
刺人心 2020-11-28 07:35

Facing an HTTPSHandler error while installing python packages using pip, following is the stack trace,

--------desktop:~$ pip install Django==1.3
Traceback (         


        
12条回答
  •  长情又很酷
    2020-11-28 07:54

    On OSX, brew kept refusing to link against its openssl with this error:

    15:27 $ brew link --force openssl
    Warning: Refusing to link: openssl
    Linking keg-only openssl means you may end up linking against the insecure,
    deprecated system OpenSSL while using the headers from Homebrew's openssl.
    Instead, pass the full include/library paths to your compiler e.g.:
      -I/usr/local/opt/openssl/include -L/usr/local/opt/openssl/lib
    

    I finally was able to get it working with:

      brew remove openssl
      brew uninstall --force openssl
      brew install openssl
      export LDFLAGS=-L/usr/local/opt/openssl/lib
      export CPPFLAGS=-I/usr/local/opt/openssl/include
      brew remove python
      brew update
      brew install python
    

提交回复
热议问题