Miniconda on WSL2 (Ubuntu 20.04) fails with CondaHTTPError: HTTP 000 CONNECTION FAILED
Asked Answered
D

3

13

I am on a WSL2 with Ubuntu and wanted to install Miniconda version 4.9.2. The installation went effortlessly, but I can now not connect to anaconda to install packages. Also simple commands like conda update conda fail with

Collecting package metadata (current_repodata.json): failed

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

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

'https://repo.anaconda.com/pkgs/main/linux-64'

You find plenty of solutions for this topic -- for pure Windows! Like here, but I could not find a solution for Ubuntu, or an Ubuntu in a WSL2.

It does not really make sense to me moving around windows-dlls, as the upper solution suggests. I tried anyway and copied similar sounding files to similar sounding folders, but that did not do the trick.

Even the 'trick' of turning of encryption did not work. Seems to be a really severe problem. Any suggestions? Thanks.

Dottiedottle answered 10/6, 2021 at 14:27 Comment(1)
I realized I was on a wsl-1, not wsl-2. I updated it to wsl-2. Not sure if that is an issue. The other one seems to be that I used zsh not bash. Installing it in bash, copying the comments of .bashrc after the installation to .zshrc worked. Ultimately, I have now a running Miniconda - but could not diagnose by 100% where the problem was. These steps simply solved the problem for me :)Dottiedottle
R
37

I had the same problem, although on WSL 1, not 2. The solution I found was exiting Ubuntu and shutting down WSL after installing conda, from cmd.exe:

> wsl --shutdown

After restarting Ubuntu, the problem went away. It didn't require installing an older version of conda first.

Regeneration answered 17/10, 2021 at 6:9 Comment(1)
Hit this on WSL2 on Debian. wsl -- shutdown fixed it.Elastance
R
9

You can try three things according to this: https://github.com/conda/conda/issues/9948

  1. Install an older version (4.7.12) of conda / miniconda see here
  2. Change file- & directory-permissions of your miniconda-installation (chmod -R 777 ~/.miniconda3) see here
  3. Restart wsl (wsl --shutdown) see here
Racialism answered 30/8, 2021 at 18:32 Comment(1)
Restarting WSL fixed it for me.Cowlick
D
3

According to this link: https://github.com/conda/conda/issues/9948#issuecomment-771901234

Please try to manually install the version below 4.7.12.1:

wget https://repo.anaconda.com/miniconda/Miniconda3-4.7.12.1-Linux-x86_64.sh
Determination answered 29/7, 2021 at 7:59 Comment(1)
I have the same problem but the issue is even that any connection to the anaconda servers is painfully slow. E.g. running that wget is somewhere running at 12kb/s. I can of course download via Windows and then install in WSL2 but once I run any install commands the download pf the packages is again in kb range slow. Any hints where I can start debugging. Can say that I tried everything that can be found via google.Rump

© 2022 - 2024 — McMap. All rights reserved.