Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update/Install in conda failing with the error: An HTTP error occurred when trying to retrieve this URL #9504

Closed
connectys opened this issue Jun 1, 2018 · 23 comments

Comments

@connectys
Copy link

I am using my corporate admin account on Windows 7. And I have also disabled ssl_verfy.

Below is the conda info and .condrac file contents:

(base) C:\Windows\system32>conda info
active environment : base
active env location : C:\Anaconda
shell level : 1
user config file : C:\Users\superys.condarc
populated config files : C:\Users\superys.condarc
conda version : 4.5.4
conda-build version : 3.10.5
python version : 3.6.5.final.0
base environment : C:\Anaconda (writable)
channel URLs : https://conda.anaconda.org/conda-forge/win-64
https://conda.anaconda.org/conda-forge/noarch
https://repo.anaconda.com/pkgs/main/win-64
https://repo.anaconda.com/pkgs/main/noarch
https://repo.anaconda.com/pkgs/free/win-64
https://repo.anaconda.com/pkgs/free/noarch
https://repo.anaconda.com/pkgs/r/win-64
https://repo.anaconda.com/pkgs/r/noarch
https://repo.anaconda.com/pkgs/pro/win-64
https://repo.anaconda.com/pkgs/pro/noarch
https://repo.anaconda.com/pkgs/msys2/win-64
https://repo.anaconda.com/pkgs/msys2/noarch
package cache : C:\Anaconda\pkgs
C:\Users\superys\AppData\Local\conda\conda\pkgs
envs directories : C:\Anaconda\envs
C:\Users\superys\AppData\Local\conda\conda\envs
C:\Users\superys.conda\envs
platform : win-64
user-agent : conda/4.5.4 requests/2.18.4 CPython/3.6.5 Windows/7 Wi
ndows/6.1.7601
administrator : True
netrc file : None
offline mode : False

.condarc file:
channels:

  • defaults
    ssl_verify: false

Error:
CondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://repo.anaconda.com/pk
gs/pro/noarch/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.

ConnectionError(MaxRetryError("HTTPSConnectionPool(host='repo.anaconda.com', por
t=443): Max retries exceeded with url: /pkgs/pro/noarch/repodata.json.bz2 (Cause
d by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0
x0000000005046400>: Failed to establish a new connection: [WinError 10061] No co
nnection could be made because the target machine actively refused it',))",),)

@jeorme
Copy link

jeorme commented Jun 14, 2018

Hi,

I have seen that the issue is closed. Could you let me know how you solve it. I have exactly the same error. I have this issue only at work

here are my settings :
active environment : None
user config file : C:\Users\jerpetit.condarc
opulated config files : C:\Users\jerpetit.condarc
conda version : 4.4.10
conda-build version : 3.4.1
python version : 3.6.4.final.0
base environment : C:\Users\jerpetit\AppData\Local\Continuum\anaconda3 (writable)
channel URLs : https://repo.continuum.io/pkgs/main/win-64
https://repo.continuum.io/pkgs/main/noarch
https://repo.continuum.io/pkgs/free/win-64
https://repo.continuum.io/pkgs/free/noarch
https://repo.continuum.io/pkgs/r/win-64
https://repo.continuum.io/pkgs/r/noarch
https://repo.continuum.io/pkgs/pro/win-64
https://repo.continuum.io/pkgs/pro/noarch
https://repo.continuum.io/pkgs/msys2/win-64
https://repo.continuum.io/pkgs/msys2/noarch
package cache : C:\Users\jerpetit\AppData\Local\Continuum\anaconda3\pkgs
C:\Users\jerpetit\AppData\Local\conda\conda\pkgs
envs directories : C:\Users\jerpetit\AppData\Local\Continuum\anaconda3\envs
C:\Users\jerpetit\AppData\Local\conda\conda\envs
C:\Users\jerpetit.conda\envs
platform : win-64
user-agent : conda/4.4.10 requests/2.18.4 CPython/3.6.4 Windows/7 Windows/6.1.7601
administrator : True
netrc file : None
offline mode : False

.condarc file:
channels:

defaults
ssl_verify: false

Here is the error message i receive :

C:\Users\jerpetit\AppData\Local\Continuum\anaconda3>conda update conda
Solving environment: failed

CondaHTTPError: HTTP 000 CONNECTION FAILED for url https://repo.continuum.io/pkgs/r/noarch/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.
SSLError(MaxRetryError('HTTPSConnectionPool(host='repo.continuum.io', port=443): Max retries exceeded with url: /pkgs/r/noarch/repodata.json.bz2 (Caused by SSLError(SSLError("bad handshake: Error([('SSL routines', 'SSL23_GET_SERVER_HELLO', 'unknown protocol')],)",),))',),)

@connectys connectys reopened this Jun 14, 2018
@connectys
Copy link
Author

Hi Jeorme,

Solution is to make changes in .condarc file. You would need to add proxy servers in the file to get rid of these errors.

@ashukrishna100
Copy link

I recently got this issue resolved. Use this command to see proxy_servers
conda config --show

If any proxy server is present in the configuration. Kindly use
conda config --remove-key proxy_servers. It will remove saved proxy servers from anaconda configuration.
Enter
conda clean --source-cache
Now your http error is gone.
Give it a try and let me know in case of any difficulty.

@johnrogers1939
Copy link

Followed ashkrishna100 above, set ssl_verify false, turned off firewall & still got SSLError bad handshake!

@ashukrishna100
Copy link

ashukrishna100 commented Sep 27, 2018

Get a fresh copy of condarc file. Don't set SSL verify as of now. Then give it a try.
Remove environmental variables and also open credentials manager. Clear any saved passwords over there.

@johnrogers1939
Copy link

johnrogers1939 commented Sep 28, 2018 via email

@johnrogers1939
Copy link

johnrogers1939 commented Sep 28, 2018 via email

@ashukrishna100
Copy link

ashukrishna100 commented Sep 28, 2018

Hi John,
Bad handshake error is when u set SSL verify to false. Not only for conda ,but if you write simple python code with set SSL_verify to False. It would throw bad handshake error in most of the cases where we are using HTTPS protocol. I would suggest you to remove set SSL_verify from the condarc. Download the fresh default condarc file. As per the current version of condarc,they don't set the SSL to false.
Repeat the above said steps then. U might get away with the error.
Note- get fresh condarc file from any of your colleagues who has a working conda. It would be in pkgs/conda4.5.4/info/test folder.

Also if there are corporate firewalls,please set the proxy in the prompt by using
set http_proxy=http://username: password@domain.com:{port}
set https_proxy=https://username: password@domain.com:{port}

@sorenwacker
Copy link

Why would it stop working from one second to another?

@jonreade
Copy link

I've had exactly the same. One minute it was working, literally the next it stopped. No corporate firewalls involved, internet connection fast, stable and up and running with no blips. Really do wonder if the bother of an extra layer is worth it when you get this kind of grief.
image

@AriaGu
Copy link

AriaGu commented Apr 16, 2019

Why would it stop working from one second to another?

you should enter the command in the anaconda prompt instead of in cmd

@msarahan
Copy link
Contributor

It is because of library loading. Behavior changed in recent python builds. See https://conda.io/projects/conda/en/latest/user-guide/troubleshooting.html#condahttperror-http-000-connection-failed for more details and ideas on workarounds. We are working to improve conda, too, so that workarounds are not necessary. The way that Windows does shared library finding is pretty annoying, but we're working to make it better.

@Jaguar100
Copy link

Jaguar100 commented May 1, 2019

Hi. I'm also getting "### CondaHTTPError: HTTP 000 CONNECTION FAILED for url https://repo.anaconda.com/pkgs/r/noarch/repodata.json.bz2". Nothing Works

I cannot install packages or update conda or any existing packages. I've tried the following from this and other posts - though some I am unable to do because I don't know how (indicated below). I am an analytics guy so not super familiar with Command line code. No luck with anything. I am on a corporate network with a firewall and using the Navigator Prompt. Can someone please help me! Does it come down to me needing a proxy server or path of a certificate bundle from my network admin? Thanks ahead of time!

  • OpenSSL: No luck. I don't have the required Admin rights to install this app.

  • Proxy Server and Cache Cleaning approach @MuqadderIqbal: No luck.

  • Adding environment paths: have not tried this as I don't know how to change the paths

  • conda config --set ssl_verify no (& "false): Neither worked

  • Update the condarc file: I don't know how to do this. So could not due the following as someone recommend:
    channels:
    defaults
    ssl_verify: true
    proxy_servers:
    http: http://proxy_server:port
    https: https://proxy_server:port

  • Activate Environments: I do not understand how to do this.

  • pip install --trusted-host pypi.org: ERROR: You must give at least one requirement to install (see "pip help install")
    @msarahan - I tried the workarounds in your link above but none of them seemed to work (())

@csoja
Copy link
Contributor

csoja commented May 3, 2019

@Jaguar100 As you are on a corporate network with a firewall, it is likely you will need to add your proxy server to your .condarc file.
See the conda documentation: https://conda.io/projects/conda/en/latest/user-guide/configuration/use-condarc.html#configure-conda-for-use-behind-a-proxy-server-proxy-servers
Assuming you are on Windows, you should open the Anaconda Prompt and type "conda info". This will tell you where you .condarc file is located among other things. It is a text file, so you can edit it however you edit other text files.

@Jaguar100
Copy link

Jaguar100 commented May 5, 2019 via email

@Whamp
Copy link

Whamp commented Jul 17, 2020

I had this same issue

conda config --set ssl_verify False

solved it for me.

I'm running Conda 4.8.2 on Windows 10 in 'corporate' style environment.

@snjay5
Copy link

snjay5 commented Sep 21, 2020

Hi,

I am also facing the same issue on my work PC. Can someone help.

(base) C:\Users\sanjay.semwal>conda create --name env1
Collecting package metadata (current_repodata.json): done
Solving environment: done

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'

@zoshi-joshi
Copy link

(base) C:\Users\sjoshi>conda config --show
add_anaconda_token: True
add_pip_as_python_dependency: True
aggressive_update_packages:

  • ca-certificates
  • certifi
  • openssl
    allow_conda_downgrades: False
    allow_cycles: True
    allow_non_channel_urls: False
    allow_softlinks: False
    always_copy: False
    always_softlink: False
    always_yes: None
    anaconda_upload: None
    auto_activate_base: True
    auto_stack: 0
    auto_update_conda: True
    bld_path:
    changeps1: True
    channel_alias: https://conda.anaconda.org
    channel_priority: flexible
    channels:
  • defaults
    client_ssl_cert: None
    client_ssl_cert_key: None
    clobber: False
    conda_build: {}
    create_default_packages: []
    croot: C:\Users\sjoshi\anaconda3\conda-bld
    custom_channels:
    pkgs/main: https://repo.anaconda.com
    pkgs/r: https://repo.anaconda.com
    pkgs/msys2: https://repo.anaconda.com
    pkgs/pro: https://repo.anaconda.com
    custom_multichannels:
    defaults:
  • https://repo.anaconda.com/pkgs/main
  • https://repo.anaconda.com/pkgs/r
  • https://repo.anaconda.com/pkgs/msys2
    default_python: 3.8
    default_threads: None
    deps_modifier: not_set
    dev: False
    disallowed_packages: []
    download_only: False
    dry_run: False
    enable_private_envs: False
    env_prompt: ({default_env})
    envs_dirs:
  • C:\Users\sjoshi\anaconda3\envs
  • C:\Users\sjoshi.conda\envs
  • C:\Users\sjoshi\AppData\Local\conda\conda\envs
    error_upload_url: https://conda.io/conda-post/unexpected-error
    execute_threads: 1
    extra_safety_checks: False
    force: False
    force_32bit: False
    force_reinstall: False
    force_remove: False
    ignore_pinned: False
    json: False
    local_repodata_ttl: 1
    migrated_channel_aliases: []
    migrated_custom_channels: {}
    non_admin_enabled: True
    notify_outdated_conda: True
    offline: False
    override_channels_enabled: True
    path_conflict: clobber
    pinned_packages: []
    pip_interop_enabled: False
    pkgs_dirs:
  • C:\Users\sjoshi\anaconda3\pkgs
  • C:\Users\sjoshi.conda\pkgs
  • C:\Users\sjoshi\AppData\Local\conda\conda\pkgs
    proxy_servers: {}
    quiet: False
    remote_backoff_factor: 1
    remote_connect_timeout_secs: 9.15
    remote_max_retries: 3
    remote_read_timeout_secs: 60.0
    repodata_fns:
  • current_repodata.json
  • repodata.json
    repodata_threads: None
    report_errors: None
    restore_free_channel: False
    rollback_enabled: True
    root_prefix: C:\Users\sjoshi\anaconda3
    safety_checks: warn
    sat_solver: pycosat
    separate_format_cache: False
    shortcuts: True
    show_channel_urls: None
    signing_metadata_url_base: https://repo.anaconda.com/pkgs/main
    solver_ignore_timestamps: False
    ssl_verify: False
    subdir: win-64
    subdirs:
  • win-64
  • noarch
    target_prefix_override:
    track_features: []
    unsatisfiable_hints: True
    unsatisfiable_hints_check_depth: 2
    update_modifier: update_specs
    use_index_cache: False
    use_local: False
    use_only_tar_bz2: False
    verbosity: 0
    verify_threads: 1
    whitelist_channels: []

I tried the things you guys mentioned above, but I can't fix the issue.

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'

Help!!!

@ycbelgium
Copy link

your SSL module is not available.
Download open SSL (Win64 OpenSSL v1.1.1d) here: Link
Then it should work
make sure you have installed Microsoft Visual C++ installed

@Questdream
Copy link

Change "HTTPS" to "HTTP" in. Condarc.
It works for me.

@irgot
Copy link

irgot commented Nov 25, 2021

Try to run "conda activate base" first, then it will probably ask you to initializa env.

@Zeweiwang0
Copy link

I had this same issue

conda config --set ssl_verify False

solved it for me.

I'm running Conda 4.8.2 on Windows 10 in 'corporate' style environment.

It really works for me thanks

@Ankitapal1995
Copy link

I had solved this issue by adding proxy_server in .condarc file.
first open linux terminal, type echo "$http_proxy" to find the proxy, copy it
then open .condarc file and add these following line and paste your proxy
proxy_servers: http: http://*****************:8080 https: http://****************:8080
I hope it will solve your issue. To know about it better follow this link
https://docs.anaconda.com/anaconda/user-guide/tasks/proxy/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests