Rahul Raj
Rahul Raj

Reputation: 3439

CondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://repo.continuum.io/pk gs/r/win-64/repodata.json.bz2>

I need to install Tensorflow and was trying to add up environment first. But I get HTTP Connection Failed error. I'm behind a corporate proxy and already defined them well in .condarc file. Here is the error I'm getting:

C:\Users\Rahul\Downloads>conda create -n tensorflow python=3.6 anaconda
Solving environment: failed
CondaHTTPError: HTTP 000 CONNECTION FAILED for url 
<https://repo.continuum.io/pk
gs/r/win-64/repodata.json.bz2>
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.
ConnectionError(MaxRetryError("HTTPSConnectionPool(host='repo.continuum.io, por
t=443): Max retries exceeded with url: /pkgs/r/win-64/repodata.json.bz2 (Caused
by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x0
000001A00393C88>: Failed to establish a new connection: [Errno 11002] getaddrinf
o failed',))",),)

I posted this issue in their issue tracker here in detail: https://github.com/conda/conda/issues/7283

As mentioned in issue tracker, I already tried resetting ssl, adding condarc file etc. But no luck so far. My proxy is working as expected and my entries in condarc file are correct. Also continuum repository is accessible via browser without issues.

None of the commands like conda update or conda install works and gives the same error stack while executing.

What might be going wrong here?

Upvotes: 22

Views: 60040

Answers (10)

Praneeth T T
Praneeth T T

Reputation: 326

CondaHTTPError: HTTP 000 CONNECTION FAILED

I too had this similar problem and tried others solution like

conda config --set ssl_verify no but not fixed and finally I figured out!

Just open Anaconda prompt instead of CMD and type all the commands there, it will fix your problems!

Anaconda Prompt(left) | Windows CMD(right) enter image description here

Upvotes: 9

Ori David
Ori David

Reputation: 362

You managed to create a new environment from the conda prompt but not from cmd because your shell wasn't initialized yet.

  1. Run conda init cmd.exe to initialize cmd.
  2. Reopen your cmd shell (must).
  3. Test conda activate and conda create commands which should work properly.

Upvotes: 2

Eike P.
Eike P.

Reputation: 3493

Adding the mentioned conda paths to the windows path (they were missing) did not fix the problem for me, nor did using the conda prompt. In fact, in the conda prompt, I noticed another problem: "The system cannot find the path specified", right when starting the prompt. I then ran "conda init" in the conda prompt, and that apparently fixed the problem. (Possibly in combination with having added the paths earlier.)

Upvotes: 1

Rahul Raj
Rahul Raj

Reputation: 3439

Apparently, the condarc file was updated and rewritten as an empty file while I ran config command. I tried running proxy settings and trusted host through command line, but it doesn't work. But then found that invoking trusted host through command line is discontinued and so I added the same in pip.ini file. After that it worked!

Like I mentioned in the GitHub issue tracker, I added below in pip.ini and it worked

trusted-host = pypi.python.org pypi.org files.pythonhosted.org

Upvotes: 6

KingKay
KingKay

Reputation: 151

On windows 10 machine:

  1. Navigate to "Environment Variables" - How to navigate to [environment_variables][1]
  2. Click on "Path"
  3. Click "New" and copy and add the following path:
  4. "C:\Users\yourusername\Anaconda3"
  5. "C:\Users\yourusername\Anaconda3\Scripts"
  6. "C:\Users\yourusername\Anaconda3\Library\bin"

Upvotes: 13

Jianyi
Jianyi

Reputation: 11

I update the .condarc file

channels:
  - http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
  - http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
  - http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda
  - http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/

Upvotes: 1

Japesh Methuku
Japesh Methuku

Reputation: 377

Screenshot of error message

I strongly recommend to copy libcrypto-1_1-x64.* libssl-1_1-x64.* from .\Library in Anaconda folder to .\DLL in Anaconda folder. I'm 100% sure that your problem will be solved. Please don't crack your heads looking for solution on all the platforms.

Upvotes: 9

Hamza
Hamza

Reputation: 89

Use Anaconda's own command prompt instead of windows one and type in the following command. No need to mess with pip.ini file

conda create -n yourenvname python=x.x

Upvotes: 1

Malay Revanth
Malay Revanth

Reputation: 259

I faced the same issue in Windows 10 machine and the below solution helps Add the following paths to environment variables:

  1. Anaconda3\Library\bin

  2. Anaconda3

  3. Anaconda3\Scripts

Upvotes: 24

user10465833
user10465833

Reputation: 11

I found that invoking trusted host through command line is discontinued and so I added the same in pip.ini file. After that it worked!

Upvotes: 1

Related Questions