CondaHTTPError: HTTP 000 CONNECTION FAILED for url

2020-08-11 00:06发布

问题:

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.

Appreciate if anyone could figure out whats going wrong here?

回答1:

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



回答2:

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.



回答3:

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


回答4:

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!



回答5:

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