Can't conda install or update packages - maybe not reaching our proxy server

21 views
Skip to first unread message

Christopher Dyer

unread,
Jul 27, 2021, 9:10:46 AM7/27/21
to Anaconda - Public, c.d...@rhein-neckar-kreis.de
Hey, we've been trying for months to conda install packages and conda update --all, but we do not seem to be reaching our organization's proxy server.

We've re-installed the individual version of Anaconda (versions Anaconda3-2020.11-Windows-x86_64, and Anaconda3-2021.05-Windows-x86_64) on two different pieces of hardware (one i5, the other i7), as individual user (not system), without adding a PATH. We are running 64-bit Windows 10 Enterprise V1909.

After opening Anaconda, click Environment -> Base -> Terminal

... and on first attempt (out of the box, all defaults), we get the following error:
----------------------------> error below

(base) C:\Users\Dyer01>conda update --all

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'

 <-------------- error above

No number of retries gets us on our way. The network definitely is not blocking anaconda.com, and the network engineering team have tried their hardest to find a solution.

If we add the HTTP_PROXY= details to the system settings, and change ssl_verify=false in the .condarc file, the only other error we get is:

---------> error below

ProxyError: Conda cannot proceed due to an error in your proxy configuration.

Check for typos and other configuration errors in any '.netrc' file in your home directory,

any environment variables ending in '_PROXY', and any other system-wide proxy

configuration settings.

<------------------- error above

Our proxy manager assures us that there is no indication of a request being made to/via the proxy server. We cannot find any .netrc files (some netrc.pyx files); and checked all known system-wide proxy configuration settings.

If we set the proxy with the Anaconda Terminal, with "set HTTPS_PROXY=https://proxy_userid:proxy_password@proxy_ip:proxy_port" we get the following detailed error report (which also cannot be sent):

--------------------> error below

(base) C:\Users\Dyer01>conda update --all

Collecting package metadata (current_repodata.json): failed

 

# >>>>>>>>>>>>>>>>>>>>>> ERROR REPORT <<<<<<<<<<<<<<<<<<<<<<

 

    Traceback (most recent call last):

      File "C:\Users\Dyer01\Anaconda3\lib\site-packages\conda\exceptions.py", line 1079, in __call__

        return func(*args, **kwargs)

      File "C:\Users\Dyer01\Anaconda3\lib\site-packages\conda\cli\main.py", line 84, in _main

        exit_code = do_call(args, p)

      File "C:\Users\Dyer01\Anaconda3\lib\site-packages\conda\cli\conda_argparse.py", line 83, in do_call

        return getattr(module, func_name)(args, parser)

      File "C:\Users\Dyer01\Anaconda3\lib\site-packages\conda\cli\main_update.py", line 20, in execute

        install(args, parser, 'update')

      File "C:\Users\Dyer01\Anaconda3\lib\site-packages\conda\cli\install.py", line 261, in install

        unlink_link_transaction = solver.solve_for_transaction(

      File "C:\Users\Dyer01\Anaconda3\lib\site-packages\conda\core\solve.py", line 114, in solve_for_transaction

        unlink_precs, link_precs = self.solve_for_diff(update_modifier, deps_modifier,

      File "C:\Users\Dyer01\Anaconda3\lib\site-packages\conda\core\solve.py", line 157, in solve_for_diff

        final_precs = self.solve_final_state(update_modifier, deps_modifier, prune, ignore_pinned,

      File "C:\Users\Dyer01\Anaconda3\lib\site-packages\conda\core\solve.py", line 262, in solve_final_state

        ssc = self._collect_all_metadata(ssc)

      File "C:\Users\Dyer01\Anaconda3\lib\site-packages\conda\common\io.py", line 88, in decorated

        return f(*args, **kwds)

      File "C:\Users\Dyer01\Anaconda3\lib\site-packages\conda\core\solve.py", line 425, in _collect_all_metadata

        index, r = self._prepare(prepared_specs)

      File "C:\Users\Dyer01\Anaconda3\lib\site-packages\conda\core\solve.py", line 1020, in _prepare

        reduced_index = get_reduced_index(self.prefix, self.channels,

      File "C:\Users\Dyer01\Anaconda3\lib\site-packages\conda\core\index.py", line 288, in get_reduced_index

        new_records = SubdirData.query_all(spec, channels=channels, subdirs=subdirs,

      File "C:\Users\Dyer01\Anaconda3\lib\site-packages\conda\core\subdir_data.py", line 140, in query_all

        result = tuple(concat(executor.map(subdir_query, channel_urls)))

      File "C:\Users\Dyer01\Anaconda3\lib\concurrent\futures\_base.py", line 611, in result_iterator

        yield fs.pop().result()

      File "C:\Users\Dyer01\Anaconda3\lib\concurrent\futures\_base.py", line 439, in result

        return self.__get_result()

      File "C:\Users\Dyer01\Anaconda3\lib\concurrent\futures\_base.py", line 388, in __get_result

        raise self._exception

      File "C:\Users\Dyer01\Anaconda3\lib\concurrent\futures\thread.py", line 57, in run

        result = self.fn(*self.args, **self.kwargs)

      File "C:\Users\Dyer01\Anaconda3\lib\site-packages\conda\core\subdir_data.py", line 132, in <lambda>

        subdir_query = lambda url: tuple(SubdirData(Channel(url), repodata_fn=repodata_fn).query(

      File "C:\Users\Dyer01\Anaconda3\lib\site-packages\conda\core\subdir_data.py", line 145, in query

        self.load()

      File "C:\Users\Dyer01\Anaconda3\lib\site-packages\conda\core\subdir_data.py", line 209, in load

        _internal_state = self._load()

      File "C:\Users\Dyer01\Anaconda3\lib\site-packages\conda\core\subdir_data.py", line 371, in _load

        raw_repodata_str = fetch_repodata_remote_request(

      File "C:\Users\Dyer01\Anaconda3\lib\site-packages\conda\core\subdir_data.py", line 694, in fetch_repodata_remote_request

        resp = session.get(join_url(url, filename), headers=headers, proxies=session.proxies,

      File "C:\Users\Dyer01\Anaconda3\lib\site-packages\requests\sessions.py", line 555, in get

        return self.request('GET', url, **kwargs)

      File "C:\Users\Dyer01\Anaconda3\lib\site-packages\requests\sessions.py", line 542, in request

        resp = self.send(prep, **send_kwargs)

      File "C:\Users\Dyer01\Anaconda3\lib\site-packages\requests\sessions.py", line 655, in send

        r = adapter.send(request, **kwargs)

      File "C:\Users\Dyer01\Anaconda3\lib\site-packages\requests\adapters.py", line 439, in send

        resp = conn.urlopen(

      File "C:\Users\Dyer01\Anaconda3\lib\site-packages\urllib3\connectionpool.py", line 696, in urlopen

        self._prepare_proxy(conn)

      File "C:\Users\Dyer01\Anaconda3\lib\site-packages\urllib3\connectionpool.py", line 964, in _prepare_proxy

        conn.connect()

      File "C:\Users\Dyer01\Anaconda3\lib\site-packages\urllib3\connection.py", line 359, in connect

        conn = self._connect_tls_proxy(hostname, conn)

      File "C:\Users\Dyer01\Anaconda3\lib\site-packages\urllib3\connection.py", line 500, in _connect_tls_proxy

        return ssl_wrap_socket(

      File "C:\Users\Dyer01\Anaconda3\lib\site-packages\urllib3\util\ssl_.py", line 432, in ssl_wrap_socket

        ssl_sock = _ssl_wrap_socket_impl(sock, context, tls_in_tls)

      File "C:\Users\Dyer01\Anaconda3\lib\site-packages\urllib3\util\ssl_.py", line 474, in _ssl_wrap_socket_impl

        return ssl_context.wrap_socket(sock)

      File "C:\Users\Dyer01\Anaconda3\lib\ssl.py", line 500, in wrap_socket

        return self.sslsocket_class._create(

      File "C:\Users\Dyer01\Anaconda3\lib\ssl.py", line 997, in _create

        raise ValueError("check_hostname requires server_hostname")

    ValueError: check_hostname requires server_hostname

 

`$ C:\Users\Dyer01\Anaconda3\Scripts\conda-script.py update --all`

 

  environment variables:

                 CIO_TEST=<not set>

        CONDA_DEFAULT_ENV=base

                CONDA_EXE=C:\Users\Dyer01\Anaconda3\condabin\..\Scripts\conda.exe

               CONDA_EXES="C:\Users\Dyer01\Anaconda3\condabin\..\Scripts\conda.exe"

             CONDA_PREFIX=C:\Users\Dyer01\Anaconda3

    CONDA_PROMPT_MODIFIER=(base)

         CONDA_PYTHON_EXE=C:\Users\Dyer01\Anaconda3\python.exe

               CONDA_ROOT=C:\Users\Dyer01\Anaconda3

              CONDA_SHLVL=1

           CURL_CA_BUNDLE=<not set>

                 HOMEPATH=\

              HTTPS_PROXY=<set>

               HTTP_PROXY=<set>

                     PATH=C:\Users\Dyer01\Anaconda3;C:\Users\Dyer01\Anaconda3\Library\mingw-w64\

                          bin;C:\Users\Dyer01\Anaconda3\Library\usr\bin;C:\Users\Dyer01\Anaconda

                          3\Library\bin;C:\Users\Dyer01\Anaconda3\Scripts;C:\Users\Dyer01\Anacon

                          da3\bin;C:\Users\Dyer01\Anaconda3;C:\Users\Dyer01\Anaconda3\Library\mi

                          ngw-w64\bin;C:\Users\Dyer01\Anaconda3\Library\usr\bin;C:\Users\Dyer01\

                          Anaconda3\Library\bin;C:\Users\Dyer01\Anaconda3\Scripts;C:\Users\Dyer0

                          1\Anaconda3\bin;C:\Users\Dyer01\Anaconda3\condabin;C:\Users\Dyer01\Ana

                          conda3;C:\Users\Dyer01\Anaconda3\Library\mingw-w64\bin;C:\Users\Dyer01

                          \Anaconda3\Library\usr\bin;C:\Users\Dyer01\Anaconda3\Library\bin;C:\Us

                          ers\Dyer01\Anaconda3\Scripts;C:\Windows\system32;C:\Windows;C:\Windows

                          \System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\S

                          ystem32\OpenSSH;C:\Program Files (x86)\NVIDIA

                          Corporation\PhysX\Common;c:\Program Files (x86)\itWatch;C:\Program

                          Files\dotnet;C:\Program Files (x86)\Microsoft SQL

                          Server\150\DTS\Binn;C:\Program Files\Azure Data Studio\bin;C:\Users\Dy

                          er01\AppData\Local\Microsoft\WindowsApps;.;C:\Program Files\Azure Data

                          Studio\bin

             PSMODULEPATH=C:\Program Files\WindowsPowerShell\Modules;C:\Windows\system32\Windows

                          PowerShell\v1.0\Modules

       REQUESTS_CA_BUNDLE=<not set>

            SSL_CERT_FILE=<not set>

 

     active environment : base

    active env location : C:\Users\Dyer01\Anaconda3

            shell level : 1

       user config file : C:\Users\Dyer01\.condarc

 populated config files : C:\Users\Dyer01\.conda\.condarc

                          C:\Users\Dyer01\.condarc

          conda version : 4.10.1

    conda-build version : 3.21.4

         python version : 3.8.8.final.0

       virtual packages : __cuda=11.0=0

                          __win=0=0

                          __archspec=1=x86_64

       base environment : C:\Users\Dyer01\Anaconda3  (writable)

      conda av data dir : C:\Users\Dyer01\Anaconda3\etc\conda

  conda av metadata url : https://repo.anaconda.com/pkgs/main

           channel URLs : https://repo.anaconda.com/pkgs/main/win-64

                          https://repo.anaconda.com/pkgs/main/noarch

                          https://repo.anaconda.com/pkgs/r/win-64

                          https://repo.anaconda.com/pkgs/r/noarch

                          https://repo.anaconda.com/pkgs/msys2/win-64

                          https://repo.anaconda.com/pkgs/msys2/noarch

          package cache : C:\Users\Dyer01\Anaconda3\pkgs

                          C:\Users\Dyer01\.conda\pkgs

                          C:\Users\Dyer01\AppData\Local\conda\conda\pkgs

       envs directories : C:\Users\Dyer01\Anaconda3\envs

                          C:\Users\Dyer01\.conda\envs

                          C:\Users\Dyer01\AppData\Local\conda\conda\envs

               platform : win-64

             user-agent : conda/4.10.1 requests/2.25.1 CPython/3.8.8 Windows/10 Windows/10.0.18362

          administrator : False

             netrc file : None

           offline mode : False

An unexpected error has occurred. Conda has prepared the above report.

Would you like conda to send this report to the core maintainers?

[y/N]: y

Upload did not complete.

<---------------------- error above

We figure it is a small issue somewhere in the configuration, but are at a loss what else we can try; or what we can do to isolate the problem. We'd greatly appreciate some ideas to either diagnose or address the potential problem. 

Abhijit Bhattacharyya

unread,
Jul 28, 2021, 2:08:07 AM7/28/21
to Anaconda - Public, xof...@gmail.com, c.d...@rhein-neckar-kreis.de
In my case, I added one new file and modified one old file. The modified file ~/.condarc contains

proxy_servers:
   http: http://user:pass...@proxy.com:port
   https: http://user:pass...@proxy.com:port
.
.
---
Here one must remember that symbols like @, #, $, % must be replaced by %40 (@),%23 (#),%24($) ,%25 etc. I stopped system-wide proxy declaration and preferred to use corresponding conf file. This will help to update using conda while it is not useful for pip.

For pip, I created a new file ~/.config/pip/pip.conf   where I entered

[global]
proxy = http://user:pass...@proxy.com:port

Trust this may help to resolve the issue.

Christopher Dyer

unread,
Jul 29, 2021, 1:01:11 AM7/29/21
to Anaconda - Public, abhi...@gmail.com, Christopher Dyer, c.d...@rhein-neckar-kreis.de

Thanks for your suggestion. While this wasnt the solution, I followed another suggestion for the proxy_servers entry (no prefixes) from Github, in .condarc:

 

channels:
- defaults
ssl_verify: false   --------OR--------   true
show_channel_urls: true
allow_other_channels: true
proxy_servers: {http: user:pa...@corp.com:8080, https: user:pa...@corp.com:8080}

 

now in the terminal, there is NO error, but it also does not look as if the update really happens - I thought there should log details of what is updated(?). This is what the terminal output looks like:

(base) C:\Users\Dyer01>conda update --all

[y/N]: y

(base) C:\Users\Dyer01>conda install -c conda-forge dowhy
[y/N]: y

(base) C:\Users\Dyer01>conda install -c conda-forge python-docx
[y/N]: y


BUT, it does not seem to run through the update, and if I "import dowhy" in python, it says there is no module dowhy.
Reply all
Reply to author
Forward
0 new messages