Tag Archives: conda

How to Solve Conda Error: An HTTP error occurred when trying to retrieve this URL.

Encounter

Collecting package metadata (current_repodata.json): failed

CondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://conda.anaconda.org/genomedk/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.
ConnectionError(MaxRetryError("HTTPSConnectionPool(host='conda.anaconda.org', port=443): Max retries exceeded with url: /genomedk/linux-64/current_repodata.json (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f4cef822390>: Failed to establish a new connection: [Errno 101] Network is unreachable'))"))

The reason is that an unknown URL has been added to the CONDA source, which can’t be used (or discarded) now

conda config --remove-key channels 
cat ~/.condarc

Problem solving

Anaconda conda activate Envirnment: Your shell has not been properly configured to use ‘conda activate’.

You shell has not been properly configured to use ‘CONDA activate’ when you open the terminal under vs code

Solution:

1. Activation environment

#activate Envirnment
source activate

2. Exit environment

conda deactivate

3. Activate base

conda activate base

It seems that this method can only solve the problem for a short time, but it will still appear when you open it again. Finally, you can uninstall vs code from the anaconda navigator interface and install it again