SSL Error while installing any package from conda prompt
Asked Answered
A

7

17

I use Anaconda Navigator for my machine learning experiments. Recently, I have started getting this strange SSL error no matter what I try to install using conda prompt. The error is SSL error. I am posting the error message that I get

Solving environment: failed

CondaHTTPError: HTTP 000 CONNECTION FAILED for url https://repo.anaconda.com/pkgs/free/linux-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.

If your current network has https://www.anaconda.com blocked, please file a support request with your network engineering team.

SSLError(MaxRetryError('HTTPSConnectionPool(host=\'repo.anaconda.com\', port=443): Max retries exceeded with url: /pkgs/free/linux-64/repodata.json.bz2 (Caused by SSLError(SSLError("bad handshake: Error([(\'SSL routines\', \'ssl3_get_server_certificate\', \'certificate verify failed\')],)",),))',),)

I have an institutional proxy server; the credentials, apt.conf file etc are all OK.

Even then I am not able to install any package using conda.

Interestingly, I have installed numerous packages using conda prompt and I never faced any such error until recently. Also, I am able to follow the links (using the browser) given in the error message which means that the proxy is not blocking the site.

I was asked to use

conda config --set ssl_verify True

but even this did not help. Any help ?

I even entered the proxy server details as given in HTTP error while using conda for installation of any packages

Ad answered 17/8, 2018 at 10:1 Comment(0)
P
33

Try copying these files from Anaconda3/Library/bin to Anaconda3/DLLs :

libcrypto-1_1-x64.dll

libssl-1_1-x64.dll

Pontormo answered 12/5, 2019 at 20:19 Comment(4)
this worked on Windows 11 on 11/21/2022Archery
Didn't work for me on Windows 11.Hardpressed
Worked for me on Windows 10 in July 2023Panada
Great, even works for Win 7Wisp
D
11

This should do the job.

conda config --set ssl_verify False
Donoghue answered 8/3, 2022 at 7:44 Comment(3)
Simple but efficient solution! Well done!Cultigen
This solution opens you up to attacks, do not use it. There are alternative, secure solutions that will work.Kobarid
Simply turn it back on once you are done?Gewirtz
I
4

When I had an SSL error related to conda on my work laptop behind a firewall, I had to set ssl_verify to false to get it to work.

Ingathering answered 10/2, 2019 at 22:47 Comment(2)
How to set it to false?Lookin
conda config --set ssl_verify False. But not work: C:\Users\gz000069>conda install -c menpo dlib Solving environment: failed CondaHTTPError: HTTP 000 CONNECTION FAILED for url <repo.anaconda.com/pkgs/free/noarch/repodata.json.bz2> Elapsed: - An HTTP error occurred when trying to retrieve this URL. HTTP errors are often intermittent, and aLookin
H
0

The following steps worked for me:

Use this command to see proxy_servers

conda config --show

This will remove saved proxy servers from anaconda configuration.

conda config --remove-key proxy_servers
conda clean --source-cache

Hope this helps you.

Hampstead answered 29/3, 2019 at 11:2 Comment(0)
U
0

This is due to .dll error

go to location where you've install anaconda3>Library>bin. search and copy following dll files

libcrypto-1_1-x64.dll libssl-1_1-x64.dll

and paste to anaconda3>DLLs.

then restart your pc.

issue will get resolved.

Ulphiah answered 20/10, 2022 at 13:22 Comment(0)
B
0

I had the same issue on my corpo computer, I modified .condarc file to overcome this issue, this file likely located at C:\Users\<YourUsername>\ if you can't find, run this on cmd -> conda config --show-sources this command will show the exact location of .condarc file. If can't see any, navigate to the documentation

If you need to add specific configurations (like proxy settings), you can add them to this file. For instance:

proxy_servers:
  http: http://your_proxy_server:your_proxy_port
  https: https://your_proxy_server:your_proxy_port

I changed my solver solver=classic, made ssl_verify=false (i don't recommend this, keep true if possible) also deleted predefined proxy paths and left http & https empty. In the end my.condarc file looks like :

proxy_servers:
  http: 
  https: 
ssl_verify: false
solver: classic
Borchers answered 3/1 at 9:40 Comment(0)
S
0

anaconda3>Library>bin

Search and copy following dll files:

libcrypto-1_1-x64.dll libssl-1_1-x64.dll

and paste to anaconda3>DLLs.

then restart your PC

issue will get resolved:)

Scriber answered 20/3 at 5:55 Comment(1)
Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.Sphinx

© 2022 - 2024 — McMap. All rights reserved.