Conda update failed: SSL error: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed

前端 未结 8 1619
借酒劲吻你
借酒劲吻你 2020-11-30 20:03

I found out that there was a problem when I tried doing

conda update 

Terminal output

conda update b

相关标签:
8条回答
  • 2020-11-30 20:27

    I faced the same problem on Mac OS X and with Miniconda. After trying many of the proposed solutions for hours I found that I needed to correctly set Condas environment – specifically requests environment variable – to use the Root certificate that my company provided rather than the generic ones that Conda provides.

    Here is how I solved it:

    1. Open Chrome, got to any website, click on the lock icon on the left of the URL. Click on «Certificate» on the dropdown. In the next window you see a stack of certificates. The uppermost (aka top line in window) is the root certificate (e.g. Zscaler Root CA in my case, yours will very likely be a different one).

    1. Open Mac OS keychain, click on «Certificates» and choose among the many certificates the root certificate that you just identified. Export this to any folder of your choosing.
    2. Convert this certificate with openssl: openssl x509 -inform der -in /path/to/your/certificate.cer -out /path/to/converted/certificate.pem
    3. For a quick check set your shell to acknowledge the certificate: export REQUESTS_CA_BUNDLE=/path/to/converted/certificate.pem
    4. To set this permanently open your shell profile (.bshrs or e.g. .zshrc) and add this line: export REQUESTS_CA_BUNDLE=/path/to/converted/certificate.pem. Now exit your terminal/shell and reopen. Check again.

    You should be set and Conda should work fine.

    0 讨论(0)
  • 2020-11-30 20:29

    For those of us on corporate networks using web filters that implement trusted man in the middle SSL solutions, it is necessary to add the web-filter certificate to the certifi cacert.pem.

    A guide to doing this is here.

    Main steps are:

    1. connect to https site with browser
    2. view and save root certificate
    3. convert cert to .pem
    4. copy and paste onto end of existing cacert.pem
    5. save
    6. SSL happiness
    0 讨论(0)
  • 2020-11-30 20:30

    For everyone struggling with this issue, you simply need to upgrade your openssl installation. I'm running windows 10, installed the latest anaconda 64-bit and am getting this error when I try to install/upgrade anything with 'conda' or 'pip'. If I uninstall the 64-bit anaconda and install the 32-bit, it works fine. I had a 64-bit version of openssl for windows installed, version 1.1.0 something. I uninstalled that and installed the latest I could find from here: https://slproweb.com/products/Win32OpenSSL.html -- there is a 64-bit version of 1.1.1 on there that worked. Now I can install packages via pip and conda successfully. Hope this helps.

    0 讨论(0)
  • 2020-11-30 20:36

    according to @jreback here https://github.com/conda/conda/issues/1166

    conda config --set ssl_verify false 
    

    will turn off this feature, e.g. here

    0 讨论(0)
  • 2020-11-30 20:42

    This seemed to do the trick for me:

    conda remove certifi
    conda install certifi
    

    Then you can do whatever you were trying to do before, e.g.

    conda update --all
    
    0 讨论(0)
  • 2020-11-30 20:46

    That SSL error is misleading. I am using Anaconda 3, conda version 4.6.11, have the most current version of openssl on a Windows 10 instance. I got the issue resolved by changing the security settings on the Anaconda3 folder to Full Control. Don't think this helped, but I also have modified the ..\Anaconda3\Lib\site-packages\certifi\cacert.pem file to include the company's SSL cert.

    Hope this info helps you.

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