Could not install packages due to an EnvironmentError: Could not find a suitable TLS CA certificate bundle, invalid path

前端 未结 3 1566
太阳男子
太阳男子 2021-01-03 15:38

I get this error:

Could not install packages due to an EnvironmentError: Could not find a suitable TLS CA certificate bundle, invalid path: /home/yosr

相关标签:
3条回答
  • 2021-01-03 15:52

    In Windows 10, 1. Find the location of certifi with following commands to check if installed already

    import certifi
    certifi.where()
    
    1. Note down the path of cacert.pem file

    2. Search for the pip.ini file in windows explorer and edit the file in notepad and set the path = <file path of cacert.pem >

    0 讨论(0)
  • 2021-01-03 16:01

    You need to allow pip to reference to the correct certificate. check the certificate first;

    python -c "import certifi; print(certifi.where())"
    

    Then first test it manually;

    pip install -r requirements.txt --cert=<the above certificate path>
    

    If that works fine, then update this path on pip.conf file located at $HOME/.pip/pip.conf (or %APPDATA%\pip\pip.ini on Windows). e.g.

    [global]
    cert = /usr/local/share/ca-certificate/mycert.crt
    
    0 讨论(0)
  • 2021-01-03 16:17

    If you're on Mac (mine is 10.13.6), use the following command:

    (security find-certificate -a -p ls /System/Library/Keychains/SystemRootCertificates.keychain &&        security find-certificate -a -p ls /Library/Keychains/System.keychain) > $HOME/.mac-ca-roots
    

    Then do modify .bashrc with

    export REQUESTS_CA_BUNDLE="$HOME/.mac-ca-roots"
    

    Then do

    $ source ~/.bashrc
    
    0 讨论(0)
提交回复
热议问题