Updating scikit-learn to latest version with Anaconda environment fails with http error 000

Question:

I use Anaconda3 installed on my pc Win10 64bits.

I noticed it runs with an outdated scikit learn version (0.21.3),
and I am trying to update it (0.24.1 available on https://repo.anaconda.com/pkgs/main/win-64/)

I do this:

  1. cmd
  2. I go in the script directory D:ProgramDataAnaconda3Scripts
  3. conda update scikit-learn

it fails with this error message:

ProgramDataAnaconda3Scripts>conda update scikit-learn
Collecting package metadata (current_repodata.json): failed

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

It is my personal PC,
I have access to websites:
https://www.anaconda.com
and
https://repo.anaconda.com/pkgs/main/win-64/
from my webbrowser chrome, without any problem.

So what could be wrong here ?
How can I update sucessfully ?

I can download the files from https://repo.anaconda.com by hand if necessary, but how to install it ?

Asked By: Malo

||

Answers:

I made it work, so I share the way I did it:
You have to run the conda command from an Anaconda environnement, not directly from the command line.

Waring: it is not recommended to use pip when you have Anaconda installed

  1. in windows menu, search Anaconda

  2. launch Anaconda Navigator Anaconda3 gui

  3. on the left menu, click "environments"

  4. next to "base (root)", click on the green arrow/triangle

  5. select "Open Terminal"

  6. type the command line:

    conda install scikit-learn==0.24.1

It worked without error.

Answered By: Malo

First of all, you should have a look at this thread:

  1. https://github.com/conda/conda/issues/9746#issuecomment-616314792.
    You have to copy libcrypto-1_1-x64.* and libssl-1_1-x64.* from Anaconda3Librarybin to Anaconda3DLLs.

If it doesn’t work, you can try this:

  1. Open Anaconda Prompt, it will open in this directory:
    (base) C:UsersUserName>
  2. Try pip to install sci-kit-learn:
    pip install pip --upgrade and then pip install -U scikit-learn

Let me know if this works!

Answered By: Varad Pimpalkhute