Issues with installing python libraries on Windows : CondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://conda.anaconda.org/anaconda/win-64

97,562

Solution 1

Execute the following command in the cmd prompt/terminal:

conda config --set ssl_verify no

Solution 2

This works a charm:-

Just copy these:-

  1. libcrypto-1_1-x64.dll

  2. libssl-1_1-x64.dll

from D:\Anaconda3\Library\bin to D:\Anaconda3\DLLs.

Solution 3

I try to create a virtual env with python 2.7 with anaconda, the base env is python 3.7. I encounter the exactly same problem. It turns out that there isn't such problem with other virtual envs with python 3.7 or 3.6.

This post works perfectly to solve my problem on win7 with anaconda prompt. It basically says you need to add the following directories into your user environment path in windows (go to Start and type in: View Advanced System Settings, then select Environmental Variables: then select Path and click Edit: finally you can click New and add a path):

C:\your_directory_to_anaconda3\Anaconda3\Scripts

C:\your_directory_to_anaconda3\Anaconda3\

C:\your_directory_to_anaconda3\Anaconda3\Library\bin -- This is the directory for openssl

Solution 4

If you added conda to your PATH variables, remove it and use the "Anaconda Prompt". This solved the problem for me.

See: https://github.com/conda/conda/issues/8046#issuecomment-450582208

Solution 5

I faced this issue when I tried to create environment. I solved it by first activating conda base environment by using:

conda activate base

then I created the environment

conda create -n myenv python=3.7
Share:
97,562
Peter Lucas
Author by

Peter Lucas

Updated on February 17, 2022

Comments

  • Peter Lucas
    Peter Lucas about 2 years

    I'd like to install the pymongo library but I'm getting the following error:

        (C:\Users\xxxxxxx\AppData\Local\Continuum\anaconda3) C:\Users\xxxxxxx>
        conda install -c anaconda pymongo
    
        Fetching package metadata ...
        CondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://conda.anaconda.org/a
        naconda/win-64/repodata.json>
        Elapsed: -
        
        An HTTP error occurred when trying to retrieve this URL.
        HTTP errors are often intermittent, and a simple retry will get you on your way.
        
        ConnectTimeout(MaxRetryError("HTTPSConnectionPool(host='conda.anaconda.org', por
        t=443): Max retries exceeded with url: /anaconda/win-64/repodata.json (Caused by
         ConnectTimeoutError(<urllib3.connection.VerifiedHTTPSConnection object at 0x000
        00000054D6128>, 'Connection to conda.anaconda.org timed out. (connect timeout=9.
        15)'))",),)
    

    Steps taken to resolve:

    1. Update C:\Users\\xxxxxxx\.condarc file with the following:
    
    channels:
      - defaults
    ssl_verify: false
    proxy_servers:
    http: http://sproxy.fg.xxx.com:1000
    https: https://sproxy.fg.xxx.com:1000
    
    2. (C:\Users\xxxxxxx\AppData\Local\Continuum\anaconda3) C:\Users\xxxxxxx>
        conda config --set ssl_verify False
    

    Additional Info:

    (C:\Users\xxxxxxx\AppData\Local\Continuum\anaconda3) C:\Users\xxxxxxx>
    conda info
    
    Current conda install:
    
                   platform : win-64
              conda version : 4.3.27
           conda is private : False
          conda-env version : 4.3.27
        conda-build version : 3.0.22
             python version : 3.6.2.final.0
           requests version : 2.18.4
                config file : C:\Users\xxxxxxx\.condarc
                 netrc file : None
               offline mode : False
                 user-agent : conda/4.3.27 requests/2.18.4 CPython/3.6.2 Windows/7 W
    indows/6.1.7601
              administrator : False
    

    A number of posts online simply reinstalled Anaconda, any other options apart from a fresh install?

  • Karthick S
    Karthick S almost 4 years
    thank you, this is the right fix. It it too tempting to add conda.exe location to path and then try but that causes a lot of trouble. Anaconda Prompt has all the right settings to get conda working.
  • Luk164
    Luk164 over 3 years
    Worked for me to, any explanation on what went wrong? Why are these not already present?
  • Lixing Liang
    Lixing Liang over 3 years
    Amazing, it worked for me. I tried turning off ssl_verify, but it didn't work.
  • Prasoon Gupta
    Prasoon Gupta over 3 years
    Green tick should be on this comment.
  • Swapnil
    Swapnil about 3 years
    @Luk164 Idk maybe some error while installing or maybe it'd work fine if we install it on the C drive.
  • William
    William about 3 years
    I also tried the set ssl_verify method above then tried this. This ultimately worked for me.
  • Imran Faruqi
    Imran Faruqi about 3 years
    If you add the Library\bin to path variable, you wouldn't need to copy and paste the files
  • Kimanthi K.
    Kimanthi K. about 3 years
    I almost gave up. It was around 2 am when I saw this man. It solves everything
  • pratyush
    pratyush about 3 years
    Its not a good idea to unset ssl verification unless you know what you are doing. The other answer works for me for a brand new anaconda installation on windows.
  • Laurent
    Laurent almost 3 years
    tried other answers. Only this one worked for me. Thanks.
  • Subangkar KrS
    Subangkar KrS almost 3 years
    After doing this, removing the existing env and recreating that worked out for me
  • CircleOnCircles
    CircleOnCircles over 2 years
    Oct, 2021. This is still working for me.
  • Jeremy Weirich
    Jeremy Weirich over 2 years
    This was what I needed, none of the other fixes had an impact.
  • Anthony Nash
    Anthony Nash over 2 years
    For Win 11 Pro Insider Preview using PyCharm with Conda, this worked for me.
  • brohjoe
    brohjoe over 2 years
    Thank you so much @Swapnil...it took a minute to install and I crossed my fingers but it works like a charm!!! I'm going to set my environment per Imran as well. Thanks so much guys!!! I hope your numbers go up big time!
  • mrk
    mrk over 2 years
    this is probably only the reason when you have "channels" in your config file
  • Mattkwish
    Mattkwish over 2 years
    This is what fixed it for me, deleted the folder it installed to, re-ran the installer, checked this box (didnt have it checked prior), error went away.
  • DanielBell99
    DanielBell99 about 2 years
    You absolute babe @Swapnil
  • user108569
    user108569 about 2 years
    that is exactly what anaconda tells you to do in the docs here. they don't explain why.
  • Foggy
    Foggy about 2 years
    This was the only thing that worked for me. I tried re-installing Anaconda, upgrading anaconda, changing my path variable, and moving the DLL's around. This definitely makes me uncomfortable too
  • Foggy
    Foggy about 2 years
    If you navigate to the repo from your browser https://repo.anaconda.com and you receive a warning like NET::ERR_CERT_AUTHORITY_INVALID then this is your best solution.
  • mpc-DT
    mpc-DT almost 2 years
    In my case, the mistake was the file named"condaarc" instead of ".condaarc" (leading "." missing)