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

PythonSslHttpsAnacondaConda

Python Problem Overview


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?

Python Solutions


Solution 1 - Python

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 2 - Python

Execute the following command in the cmd prompt/terminal:

conda config --set ssl_verify no

Solution 3 - Python

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 - Python

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 - Python

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

Solution 6 - Python

  1. Check the proxy URL
  2. Verify .condarc file

For me, the problem was with the indentation in the .condarc file.

proxy_servers:
  http: http://testproxy:8080
  https: https://testproxy:8080

Solution 7 - Python

My authenticated proxy server is configured with a domain whitelist for massive and repeated downloads so root or local sudoer doesn't need to be authenticated. Adding conda.anaconda.org is not enough as this repo redirect its traffic to amazonaws.com. In my case, adding ".amazonaws.com" to the whitelist solved the issue.

Solution 8 - Python

The issue was resolved by adding a username and password to file C:\Users\xxxxx.condarc

channels:
  - defaults
ssl_verify: false
proxy_servers:
  http: http://xxxxx:[email protected]:yyyy
  https: https://xxxxx:[email protected]:yyyy

Solution 9 - Python

I had the same problem on Windows 10-64 bit and intuitively installed the 64-bit version of miniconda. However, it results in exactly the same error above. Installing 32 bit conda installer has resolved the issue

Solution 10 - Python

I also had the Same Issue, I resolved by installing 32 bit Anaconda Installer. Which resolved the CondaHTTPError: HTTP 000 CONNECTION, on Windows 64 bit.

Solution 11 - Python

I faced this issues after "conda clean -a" on win-64.
Activating and deactivating existing conda env resolved the issue.

Solution 12 - Python

You might need to upgrade your openssl installation

You can download it here (Try the latest version):

https://slproweb.com/products/Win32OpenSSL.html


Source: https://github.com/ContinuumIO/anaconda-issues/issues/6424#issuecomment-464660808

Solution 13 - Python

Before installing some package (pydicom) the installation run just fine. After it I tried to install matplotlib, but I got the same error as yours.

I tried conda config --set ssl_verify no but it didn't solve the problem so I set it again to true.

Fortunately, I had a virtual environment where I installed my packages. I closed all Anaconda prompts and tried in a new test environment. Magically, the install worked. I came back to my original virtual env and run the install again, and it worked!.

It might be that I just had to wait for some time before I could use conda install again.

One other thing I could do is remove the package that caused the problem, but I didn't have the chance to try it. If it has anything to do with some virtual environments not being affected, then one possible way to guard against this is to clone the environment before installing any new package.

Edit: I tried the same solution but It did not work. But instead of showing the error immediately, it asks me whether I want to proceed. I deactivated the env, and re-opened anaconda prompt, then did the same steps as above and worked again.

Solution 14 - Python

Uninstalling and reinstalling anaconda for all users (instead, of current user only, requires admin privileges) and activating the option to add Anaconda to PATH during the installation process, fixed the issues for me.

enter image description here

Solution 15 - Python

Came across the CondaHTTP Connection error after installing Anaconda environment on a new Windows 10 computer. I tried virtually all the recommendations above unsuccessfully! Looking up the Anaconda archives ( https://repo.continuum.io/archive/ ), I downloaded the immediate previous release .... and on installation and rebooting my PC, all is now wellscreenshot of release

Solution 16 - Python

In short - installing Microsoft Visual C++ Redistributable for Visual Studio solved my problem.

In more detail: upon trying a suggested solution of installing a new version of OpenSSL, the installation process told me I was missing a dependency - the Visual Studio Redistributable package. The installer led me to a direct download page of the 2017 version. I can't find that page now, but the official release of 2019 can be found here, and should work as well (found under Other Tools and Frameworks).

Solution 17 - Python

Thank you everyone for your responses. In my case, I found out that my Kaspersky Internet Security was blocking it the whole time. The moment I quit the application all applications were downloaded. Please check your firewall settings before trying all the above options.

Solution 18 - Python

I tried all of these solutions and none worked for me. After running the command

conda config --remove-key channels

in the Anaconda Prompt, everything started working for me on my next attempt.

Solution 19 - Python

Adding that I had the same problem on ubuntu on WSL. None of the solutions worked for me, until I realized I was working on WSL version 1 (I thought I'd already upgraded). Upgrading from WSL 1 to WSL 2 solved the problem for me.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionPeter LucasView Question on Stackoverflow
Solution 1 - PythonSwapnilView Answer on Stackoverflow
Solution 2 - Pythonkamal duaView Answer on Stackoverflow
Solution 3 - PythontalentcatView Answer on Stackoverflow
Solution 4 - PythonandiwiView Answer on Stackoverflow
Solution 5 - PythonBarath MView Answer on Stackoverflow
Solution 6 - PythonVinod SangaleView Answer on Stackoverflow
Solution 7 - PythonMax BenelhadjView Answer on Stackoverflow
Solution 8 - PythonPeter LucasView Answer on Stackoverflow
Solution 9 - PythonMehmet Ali MeramView Answer on Stackoverflow
Solution 10 - PythonSameer Kumar ChoudharyView Answer on Stackoverflow
Solution 11 - PythonNeeraj JainView Answer on Stackoverflow
Solution 12 - PythonAbdulrahman BresView Answer on Stackoverflow
Solution 13 - PythonMichael HeidelbergView Answer on Stackoverflow
Solution 14 - PythonpgebertView Answer on Stackoverflow
Solution 15 - PythonVictor Ochieng'View Answer on Stackoverflow
Solution 16 - PythonShovaltView Answer on Stackoverflow
Solution 17 - PythonsciencejediView Answer on Stackoverflow
Solution 18 - PythonayrunnView Answer on Stackoverflow
Solution 19 - PythonYanivView Answer on Stackoverflow