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

"ValueError: check_hostname requires server_hostname" when trying to update conda #10590

Closed
tykutar opened this issue Apr 6, 2021 · 23 comments
Closed
Labels
locked [bot] locked due to inactivity

Comments

@tykutar
Copy link

tykutar commented Apr 6, 2021

Current Behavior

  • conda update conda results in ValueError: check_hostname requires server_hostname
  • Error report upload is unsuccessful.
  • Using conda install --revision [#] results in the same error.

Steps to Reproduce

(base) C:\Users\user>conda update conda
Collecting package metadata (current_repodata.json): failed

CondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://conda.anaconda.org/conda-forge/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.
'https://conda.anaconda.org/conda-forge/win-64'

(base) C:\Users\user>set http_proxy=http://[username]:[password]@[IPaddress]:[port]

(base) C:\Users\user>set https_proxy=https://[username]:[password]@[IPaddress]:[port]

(base) C:\Users\user>conda update conda
Collecting package metadata (current_repodata.json): failed

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

    Traceback (most recent call last):
      File "C:\Users\user\Miniconda3\lib\site-packages\conda\exceptions.py", line 1079, in __call__
        return func(*args, **kwargs)
      File "C:\Users\user\Miniconda3\lib\site-packages\conda\cli\main.py", line 84, in _main
        exit_code = do_call(args, p)
      File "C:\Users\user\Miniconda3\lib\site-packages\conda\cli\conda_argparse.py", line 83, in do_call
        return getattr(module, func_name)(args, parser)
      File "C:\Users\user\Miniconda3\lib\site-packages\conda\cli\main_update.py", line 20, in execute
        install(args, parser, 'update')
      File "C:\Users\user\Miniconda3\lib\site-packages\conda\cli\install.py", line 261, in install
        unlink_link_transaction = solver.solve_for_transaction(
      File "C:\Users\user\Miniconda3\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\user\Miniconda3\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\user\Miniconda3\lib\site-packages\conda\core\solve.py", line 262, in solve_final_state
        ssc = self._collect_all_metadata(ssc)
      File "C:\Users\user\Miniconda3\lib\site-packages\conda\common\io.py", line 88, in decorated
        return f(*args, **kwds)
      File "C:\Users\user\Miniconda3\lib\site-packages\conda\core\solve.py", line 425, in _collect_all_metadata
        index, r = self._prepare(prepared_specs)
      File "C:\Users\user\Miniconda3\lib\site-packages\conda\core\solve.py", line 1020, in _prepare
        reduced_index = get_reduced_index(self.prefix, self.channels,
      File "C:\Users\user\Miniconda3\lib\site-packages\conda\core\index.py", line 276, in get_reduced_index
        new_records = SubdirData.query_all(spec, channels=channels, subdirs=subdirs,
      File "C:\Users\user\Miniconda3\lib\site-packages\conda\core\subdir_data.py", line 120, in query_all
        result = tuple(concat(executor.map(subdir_query, channel_urls)))
      File "C:\Users\user\Miniconda3\lib\concurrent\futures\_base.py", line 611, in result_iterator
        yield fs.pop().result()
      File "C:\Users\user\Miniconda3\lib\concurrent\futures\_base.py", line 439, in result
        return self.__get_result()
      File "C:\Users\user\Miniconda3\lib\concurrent\futures\_base.py", line 388, in __get_result
        raise self._exception
      File "C:\Users\user\Miniconda3\lib\concurrent\futures\thread.py", line 57, in run
        result = self.fn(*self.args, **self.kwargs)
      File "C:\Users\user\Miniconda3\lib\site-packages\conda\core\subdir_data.py", line 112, in <lambda>
        subdir_query = lambda url: tuple(SubdirData(Channel(url), repodata_fn=repodata_fn).query(
      File "C:\Users\user\Miniconda3\lib\site-packages\conda\core\subdir_data.py", line 125, in query
        self.load()
      File "C:\Users\user\Miniconda3\lib\site-packages\conda\core\subdir_data.py", line 189, in load
        _internal_state = self._load()
      File "C:\Users\user\Miniconda3\lib\site-packages\conda\core\subdir_data.py", line 259, in _load
        raw_repodata_str = fetch_repodata_remote_request(
      File "C:\Users\user\Miniconda3\lib\site-packages\conda\core\subdir_data.py", line 499, in fetch_repodata_remote_request
        resp = session.get(join_url(url, filename), headers=headers, proxies=session.proxies,
      File "C:\Users\user\Miniconda3\lib\site-packages\requests\sessions.py", line 555, in get
        return self.request('GET', url, **kwargs)
      File "C:\Users\user\Miniconda3\lib\site-packages\requests\sessions.py", line 542, in request
        resp = self.send(prep, **send_kwargs)
      File "C:\Users\user\Miniconda3\lib\site-packages\requests\sessions.py", line 655, in send
        r = adapter.send(request, **kwargs)
      File "C:\Users\user\Miniconda3\lib\site-packages\requests\adapters.py", line 439, in send
        resp = conn.urlopen(
      File "C:\Users\user\Miniconda3\lib\site-packages\urllib3\connectionpool.py", line 696, in urlopen
        self._prepare_proxy(conn)
      File "C:\Users\user\Miniconda3\lib\site-packages\urllib3\connectionpool.py", line 964, in _prepare_proxy
        conn.connect()
      File "C:\Users\user\Miniconda3\lib\site-packages\urllib3\connection.py", line 359, in connect
        conn = self._connect_tls_proxy(hostname, conn)
      File "C:\Users\user\Miniconda3\lib\site-packages\urllib3\connection.py", line 500, in _connect_tls_proxy
        return ssl_wrap_socket(
      File "C:\Users\user\Miniconda3\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\user\Miniconda3\lib\site-packages\urllib3\util\ssl_.py", line 474, in _ssl_wrap_socket_impl
        return ssl_context.wrap_socket(sock)
      File "C:\Users\user\Miniconda3\lib\ssl.py", line 500, in wrap_socket
        return self.sslsocket_class._create(
      File "C:\Users\user\Miniconda3\lib\ssl.py", line 997, in _create
        raise ValueError("check_hostname requires server_hostname")
    ValueError: check_hostname requires server_hostname

`$ C:\Users\user\Miniconda3\Scripts\conda-script.py update conda`

  environment variables:
                 CIO_TEST=<not set>
        CONDA_DEFAULT_ENV=base
                CONDA_EXE=C:\Users\user\Miniconda3\condabin\..\Scripts\conda.exe
               CONDA_EXES="C:\Users\user\Miniconda3\condabin\..\Scripts\conda.exe"
             CONDA_PREFIX=C:\Users\user\Miniconda3
    CONDA_PROMPT_MODIFIER=(base)
         CONDA_PYTHON_EXE=C:\Users\user\Miniconda3\python.exe
               CONDA_ROOT=C:\Users\user\Miniconda3
              CONDA_SHLVL=1
           CURL_CA_BUNDLE=<not set>
                 HOMEPATH=\Users\user
              HTTPS_PROXY=<set>
               HTTP_PROXY=<set>
                     PATH=C:\Users\user\Miniconda3;C:\Users\user\Miniconda3\Library\mingw-w64\bi
                          n;C:\Users\user\Miniconda3\Library\usr\bin;C:\Users\user\Miniconda3\Li
                          brary\bin;C:\Users\user\Miniconda3\Scripts;C:\Users\user\Miniconda3\bi
                          n;C:\Users\user\Miniconda3;C:\Users\user\Miniconda3\Library\mingw-w64\
                          bin;C:\Users\user\Miniconda3\Library\usr\bin;C:\Users\user\Miniconda3\
                          Library\bin;C:\Users\user\Miniconda3\Scripts;C:\Users\user\Miniconda3\
                          bin;C:\Users\user\Miniconda3\condabin;C:\Program Files
                          (x86)\Intel\iCLS Client;C:\Program Files\Intel\iCLS Client;C:\WINDOWS\
                          system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\Windo
                          wsPowerShell\v1.0;C:\Program Files (x86)\Intel\Intel(R) Management
                          Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management
                          Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management
                          Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management
                          Engine Components\IPT;C:\Program Files\Intel\WiFi\bin;C:\Program
                          Files\Common
                          Files\Intel\WirelessCommon;C:\WINDOWS\System32\OpenSSH;C:\Program
                          Files\dotnet;C:\Program Files\Zulu\zulu-11\bin;C:\Users\user\AppData\L
                          ocal\Microsoft\WindowsApps;.;C:\Users\user\AppData\Local\Programs\Pyth
                          on\Python37;C:\Users\user\AppData\Local\Programs\Python\Python37\Scrip
                          ts
             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\user\Miniconda3
            shell level : 1
       user config file : C:\Users\user\.condarc
 populated config files : C:\Users\user\.condarc
          conda version : 4.9.2
    conda-build version : not installed
         python version : 3.8.5.final.0
       virtual packages : __win=0=0
                          __archspec=1=x86_64
       base environment : C:\Users\user\Miniconda3  (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/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\user\Miniconda3\pkgs
                          C:\Users\user\.conda\pkgs
                          C:\Users\user\AppData\Local\conda\conda\pkgs
       envs directories : C:\Users\user\Miniconda3\envs
                          C:\Users\user\.conda\envs
                          C:\Users\user\AppData\Local\conda\conda\envs
               platform : win-64
             user-agent : conda/4.9.2 requests/2.25.1 CPython/3.8.5 Windows/10 Windows/10.0.19041
          administrator : False
             netrc file : None
           offline mode : False


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

If submitted, this report will be used by core maintainers to improve
future releases of conda.
Would you like conda to send this report to the core maintainers?

[y/N]: y
Upload did not complete.

Thank you for helping to improve conda.
Opt-in to always sending reports (and not see this message again)
by running

    $ conda config --set report_errors true


(base) C:\Users\user>conda list --revisions

[...]

2020-10-06 09:53:56  (rev 8)
     brotlipy  {0.7.0 (defaults/win-64) -> 0.7.0 (conda-forge/win-64)}
     ca-certificates  {2020.7.22 (defaults/win-64) -> 2020.6.20 (conda-forge/win-64)}
     certifi  {2020.6.20 (defaults/win-64) -> 2020.6.20 (conda-forge/win-64)}
     cffi  {1.14.3 (defaults/win-64) -> 1.14.3 (conda-forge/win-64)}
     chardet  {3.0.4 (defaults/win-64) -> 3.0.4 (conda-forge/win-64)}
     conda  {4.8.5 (defaults/win-64) -> 4.8.5 (conda-forge/win-64)}
     conda-package-handling  {1.6.1 (defaults/win-64) -> 1.7.0 (conda-forge/win-64)}
     cryptography  {3.1.1 (defaults/win-64) -> 3.1.1 (conda-forge/win-64)}
     idna  {2.10 (defaults/noarch) -> 2.10 (conda-forge/noarch)}
     menuinst  {1.4.16 (defaults/win-64) -> 1.4.16 (conda-forge/win-64)}
     openssl  {1.1.1h (defaults/win-64) -> 1.1.1h (conda-forge/win-64)}
     pip  {20.2.3 (defaults/win-64) -> 20.2.3 (conda-forge/noarch)}
     pycosat  {0.6.3 (defaults/win-64) -> 0.6.3 (conda-forge/win-64)}
     pycparser  {2.20 (defaults/noarch) -> 2.20 (conda-forge/noarch)}
     pyopenssl  {19.1.0 (defaults/noarch) -> 19.1.0 (conda-forge/noarch)}
     pysocks  {1.7.1 (defaults/win-64) -> 1.7.1 (conda-forge/win-64)}
     python  {3.8.1 (defaults/win-64) -> 3.8.5 (conda-forge/win-64)}
     pywin32  {227 (defaults/win-64) -> 227 (conda-forge/win-64)}
     requests  {2.24.0 (defaults/noarch) -> 2.24.0 (conda-forge/noarch)}
     ruamel_yaml  {0.15.87 (defaults/win-64) -> 0.15.80 (conda-forge/win-64)}
     setuptools  {50.3.0 (defaults/win-64) -> 49.6.0 (conda-forge/win-64)}
     six  {1.15.0 (defaults/noarch) -> 1.15.0 (conda-forge/noarch)}
     sqlite  {3.33.0 (defaults/win-64) -> 3.33.0 (conda-forge/win-64)}
     tqdm  {4.50.0 (defaults/noarch) -> 4.50.0 (conda-forge/noarch)}
     urllib3  {1.25.10 (defaults/noarch) -> 1.25.10 (conda-forge/noarch)}
     vc  {14.1 (defaults/win-64) -> 14.1 (conda-forge/win-64)}
     vs2015_runtime  {14.16.27012 (defaults/win-64) -> 14.16.27012 (conda-forge/win-64)}
     wheel  {0.35.1 (defaults/noarch) -> 0.35.1 (conda-forge/noarch)}
     win_inet_pton  {1.1.0 (defaults/win-64) -> 1.1.0 (conda-forge/win-64)}
     wincertstore  {0.2 (defaults/win-64) -> 0.2 (conda-forge/win-64)}
     yaml  {0.2.5 (defaults/win-64) -> 0.2.5 (conda-forge/win-64)}
    -zlib-1.2.11 (defaults/win-64)
    +python_abi-3.8 (conda-forge/win-64)

2021-03-29 09:55:05  (rev 9)
     brotlipy  {0.7.0 (conda-forge/win-64) -> 0.7.0 (conda-forge/win-64)}
     ca-certificates  {2020.6.20 (conda-forge/win-64) -> 2020.12.5 (conda-forge/win-64)}
     certifi  {2020.6.20 (conda-forge/win-64) -> 2020.12.5 (conda-forge/win-64)}
     cffi  {1.14.3 (conda-forge/win-64) -> 1.14.5 (conda-forge/win-64)}
     chardet  {3.0.4 (conda-forge/win-64) -> 4.0.0 (conda-forge/win-64)}
     conda  {4.8.5 (conda-forge/win-64) -> 4.9.2 (conda-forge/win-64)}
     conda-package-handling  {1.7.0 (conda-forge/win-64) -> 1.7.2 (conda-forge/win-64)}
     cryptography  {3.1.1 (conda-forge/win-64) -> 3.4.7 (conda-forge/win-64)}
     openssl  {1.1.1h (conda-forge/win-64) -> 1.1.1k (conda-forge/win-64)}
     pip  {20.2.3 (conda-forge/noarch) -> 21.0.1 (conda-forge/noarch)}
     pycosat  {0.6.3 (conda-forge/win-64) -> 0.6.3 (conda-forge/win-64)}
     pyopenssl  {19.1.0 (conda-forge/noarch) -> 20.0.1 (conda-forge/noarch)}
     pysocks  {1.7.1 (conda-forge/win-64) -> 1.7.1 (conda-forge/win-64)}
     pywin32  {227 (conda-forge/win-64) -> 300 (conda-forge/win-64)}
     requests  {2.24.0 (conda-forge/noarch) -> 2.25.1 (conda-forge/noarch)}
     ruamel_yaml  {0.15.80 (conda-forge/win-64) -> 0.15.80 (conda-forge/win-64)}
     setuptools  {49.6.0 (conda-forge/win-64) -> 49.6.0 (conda-forge/win-64)}
     sqlite  {3.33.0 (conda-forge/win-64) -> 3.35.3 (conda-forge/win-64)}
     tqdm  {4.50.0 (conda-forge/noarch) -> 4.59.0 (conda-forge/noarch)}
     urllib3  {1.25.10 (conda-forge/noarch) -> 1.26.4 (conda-forge/noarch)}
     vc  {14.1 (conda-forge/win-64) -> 14.2 (conda-forge/win-64)}
     vs2015_runtime  {14.16.27012 (conda-forge/win-64) -> 14.28.29325 (conda-forge/win-64)}
     wheel  {0.35.1 (conda-forge/noarch) -> 0.36.2 (conda-forge/noarch)}
     win_inet_pton  {1.1.0 (conda-forge/win-64) -> 1.1.0 (conda-forge/win-64)}
     wincertstore  {0.2 (conda-forge/win-64) -> 0.2 (conda-forge/win-64)}

(base) C:\Users\user>conda install --revision 8

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

    Traceback (most recent call last):
      File "C:\Users\user\Miniconda3\lib\site-packages\conda\exceptions.py", line 1079, in __call__
        return func(*args, **kwargs)
      File "C:\Users\user\Miniconda3\lib\site-packages\conda\cli\main.py", line 84, in _main
        exit_code = do_call(args, p)
      File "C:\Users\user\Miniconda3\lib\site-packages\conda\cli\conda_argparse.py", line 83, in do_call
        return getattr(module, func_name)(args, parser)
      File "C:\Users\user\Miniconda3\lib\site-packages\conda\cli\main_install.py", line 20, in execute
        install(args, parser, 'install')
      File "C:\Users\user\Miniconda3\lib\site-packages\conda\cli\install.py", line 243, in install
        index = get_index(channel_urls=index_args['channel_urls'],
      File "C:\Users\user\Miniconda3\lib\site-packages\conda\common\io.py", line 88, in decorated
        return f(*args, **kwds)
      File "C:\Users\user\Miniconda3\lib\site-packages\conda\core\index.py", line 65, in get_index
        index = fetch_index(channel_urls, use_cache=use_cache, repodata_fn=repodata_fn)
      File "C:\Users\user\Miniconda3\lib\site-packages\conda\core\index.py", line 82, in fetch_index
        index.update((rec, rec) for rec in f.iter_records())
      File "C:\Users\user\Miniconda3\lib\site-packages\conda\core\subdir_data.py", line 209, in iter_records
        self.load()
      File "C:\Users\user\Miniconda3\lib\site-packages\conda\core\subdir_data.py", line 189, in load
        _internal_state = self._load()
      File "C:\Users\user\Miniconda3\lib\site-packages\conda\core\subdir_data.py", line 259, in _load
        raw_repodata_str = fetch_repodata_remote_request(
      File "C:\Users\user\Miniconda3\lib\site-packages\conda\core\subdir_data.py", line 499, in fetch_repodata_remote_request
        resp = session.get(join_url(url, filename), headers=headers, proxies=session.proxies,
      File "C:\Users\user\Miniconda3\lib\site-packages\requests\sessions.py", line 555, in get
        return self.request('GET', url, **kwargs)
      File "C:\Users\user\Miniconda3\lib\site-packages\requests\sessions.py", line 542, in request
        resp = self.send(prep, **send_kwargs)
      File "C:\Users\user\Miniconda3\lib\site-packages\requests\sessions.py", line 655, in send
        r = adapter.send(request, **kwargs)
      File "C:\Users\user\Miniconda3\lib\site-packages\requests\adapters.py", line 439, in send
        resp = conn.urlopen(
      File "C:\Users\user\Miniconda3\lib\site-packages\urllib3\connectionpool.py", line 696, in urlopen
        self._prepare_proxy(conn)
      File "C:\Users\user\Miniconda3\lib\site-packages\urllib3\connectionpool.py", line 964, in _prepare_proxy
        conn.connect()
      File "C:\Users\user\Miniconda3\lib\site-packages\urllib3\connection.py", line 359, in connect
        conn = self._connect_tls_proxy(hostname, conn)
      File "C:\Users\user\Miniconda3\lib\site-packages\urllib3\connection.py", line 500, in _connect_tls_proxy
        return ssl_wrap_socket(
      File "C:\Users\user\Miniconda3\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\user\Miniconda3\lib\site-packages\urllib3\util\ssl_.py", line 474, in _ssl_wrap_socket_impl
        return ssl_context.wrap_socket(sock)
      File "C:\Users\user\Miniconda3\lib\ssl.py", line 500, in wrap_socket
        return self.sslsocket_class._create(
      File "C:\Users\user\Miniconda3\lib\ssl.py", line 997, in _create
        raise ValueError("check_hostname requires server_hostname")
    ValueError: check_hostname requires server_hostname

`$ C:\Users\user\Miniconda3\Scripts\conda-script.py install --revision 8`

  environment variables:
                 CIO_TEST=<not set>
        CONDA_DEFAULT_ENV=base
                CONDA_EXE=C:\Users\user\Miniconda3\condabin\..\Scripts\conda.exe
               CONDA_EXES="C:\Users\user\Miniconda3\condabin\..\Scripts\conda.exe"
             CONDA_PREFIX=C:\Users\user\Miniconda3
    CONDA_PROMPT_MODIFIER=(base)
         CONDA_PYTHON_EXE=C:\Users\user\Miniconda3\python.exe
               CONDA_ROOT=C:\Users\user\Miniconda3
              CONDA_SHLVL=1
           CURL_CA_BUNDLE=<not set>
                 HOMEPATH=\Users\user
              HTTPS_PROXY=<set>
               HTTP_PROXY=<set>
                     PATH=C:\Users\user\Miniconda3;C:\Users\user\Miniconda3\Library\mingw-w64\bi
                          n;C:\Users\user\Miniconda3\Library\usr\bin;C:\Users\user\Miniconda3\Li
                          brary\bin;C:\Users\user\Miniconda3\Scripts;C:\Users\user\Miniconda3\bi
                          n;C:\Users\user\Miniconda3;C:\Users\user\Miniconda3\Library\mingw-w64\
                          bin;C:\Users\user\Miniconda3\Library\usr\bin;C:\Users\user\Miniconda3\
                          Library\bin;C:\Users\user\Miniconda3\Scripts;C:\Users\user\Miniconda3\
                          bin;C:\Users\user\Miniconda3\condabin;C:\Program Files
                          (x86)\Intel\iCLS Client;C:\Program Files\Intel\iCLS Client;C:\WINDOWS\
                          system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\Windo
                          wsPowerShell\v1.0;C:\Program Files (x86)\Intel\Intel(R) Management
                          Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management
                          Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management
                          Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management
                          Engine Components\IPT;C:\Program Files\Intel\WiFi\bin;C:\Program
                          Files\Common
                          Files\Intel\WirelessCommon;C:\WINDOWS\System32\OpenSSH;C:\Program
                          Files\dotnet;C:\Program Files\Zulu\zulu-11\bin;C:\Users\user\AppData\L
                          ocal\Microsoft\WindowsApps;.;C:\Users\user\AppData\Local\Programs\Pyth
                          on\Python37;C:\Users\user\AppData\Local\Programs\Python\Python37\Scrip
                          ts
             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\user\Miniconda3
            shell level : 1
       user config file : C:\Users\user\.condarc
 populated config files : C:\Users\user\.condarc
          conda version : 4.9.2
    conda-build version : not installed
         python version : 3.8.5.final.0
       virtual packages : __win=0=0
                          __archspec=1=x86_64
       base environment : C:\Users\user\Miniconda3  (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/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\user\Miniconda3\pkgs
                          C:\Users\user\.conda\pkgs
                          C:\Users\user\AppData\Local\conda\conda\pkgs
       envs directories : C:\Users\user\Miniconda3\envs
                          C:\Users\user\.conda\envs
                          C:\Users\user\AppData\Local\conda\conda\envs
               platform : win-64
             user-agent : conda/4.9.2 requests/2.25.1 CPython/3.8.5 Windows/10 Windows/10.0.19041
          administrator : False
             netrc file : None
           offline mode : False


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

If submitted, this report will be used by core maintainers to improve
future releases of conda.
Would you like conda to send this report to the core maintainers?

[y/N]: y
Upload did not complete.

Thank you for helping to improve conda.
Opt-in to always sending reports (and not see this message again)
by running

    $ conda config --set report_errors true

Expected Behavior

conda update conda worked normally prior to rev 9,
so I'm guessing rev 9 has something to do with this error.

Any help is appreciated.

Environment Information

`conda info`

     active environment : base
    active env location : C:\Users\user\Miniconda3
            shell level : 1
       user config file : C:\Users\user\.condarc
 populated config files : C:\Users\user\.condarc
          conda version : 4.9.2
    conda-build version : not installed
         python version : 3.8.5.final.0
       virtual packages : __win=0=0
                          __archspec=1=x86_64
       base environment : C:\Users\user\Miniconda3  (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/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\user\Miniconda3\pkgs
                          C:\Users\user\.conda\pkgs
                          C:\Users\user\AppData\Local\conda\conda\pkgs
       envs directories : C:\Users\user\Miniconda3\envs
                          C:\Users\user\.conda\envs
                          C:\Users\user\AppData\Local\conda\conda\envs
               platform : win-64
             user-agent : conda/4.9.2 requests/2.25.1 CPython/3.8.5 Windows/10 Windows/10.0.19041
          administrator : False
             netrc file : None
           offline mode : False

`conda config --show-sources`

==> C:\Users\user\.condarc <==
channel_priority: strict
channels:
  - conda-forge
  - defaults

`conda list --show-channel-urls`

# packages in environment at C:\Users\user\Miniconda3:
#
# Name                    Version                   Build  Channel
brotlipy                  0.7.0           py38h294d835_1001    conda-forge
ca-certificates           2020.12.5            h5b45459_0    conda-forge
certifi                   2020.12.5        py38haa244fe_1    conda-forge
cffi                      1.14.5           py38hd8c33c5_0    conda-forge
chardet                   4.0.0            py38haa244fe_1    conda-forge
conda                     4.9.2            py38haa244fe_0    conda-forge
conda-package-handling    1.7.2            py38h8934438_0    conda-forge
console_shortcut          0.1.1                         4    defaults
cryptography              3.4.7            py38hd7da0ea_0    conda-forge
idna                      2.10               pyh9f0ad1d_0    conda-forge
menuinst                  1.4.16                   py38_0    conda-forge
openssl                   1.1.1k               h8ffe710_0    conda-forge
pip                       21.0.1             pyhd8ed1ab_0    conda-forge
powershell_shortcut       0.0.1                         3    defaults
pycosat                   0.6.3           py38h294d835_1006    conda-forge
pycparser                 2.20               pyh9f0ad1d_2    conda-forge
pyopenssl                 20.0.1             pyhd8ed1ab_0    conda-forge
pysocks                   1.7.1            py38haa244fe_3    conda-forge
python                    3.8.5           h60c2a47_9_cpython    conda-forge
python_abi                3.8                      1_cp38    conda-forge
pywin32                   300              py38h294d835_0    conda-forge
requests                  2.25.1             pyhd3deb0d_0    conda-forge
ruamel_yaml               0.15.80         py38h294d835_1004    conda-forge
setuptools                49.6.0           py38haa244fe_3    conda-forge
six                       1.15.0             pyh9f0ad1d_0    conda-forge
sqlite                    3.35.3               h8ffe710_0    conda-forge
tqdm                      4.59.0             pyhd8ed1ab_0    conda-forge
urllib3                   1.26.4             pyhd8ed1ab_0    conda-forge
vc                        14.2                 hb210afc_4    conda-forge
vs2015_runtime            14.28.29325          h5e1d092_4    conda-forge
wheel                     0.36.2             pyhd3deb0d_0    conda-forge
win_inet_pton             1.1.0            py38haa244fe_2    conda-forge
wincertstore              0.2             py38haa244fe_1006    conda-forge
yaml                      0.2.5                he774522_0    conda-forge

@RengarWang
Copy link

I also encountered the same problem,conda version : 4.10.1.

@RengarWang
Copy link

This problem occurs when I connect to the VPN, and there is no problem without the VPN, but my download speed is slow.

@WMQ1999
Copy link

WMQ1999 commented Apr 20, 2021

If you have set proxy-servers in .condarc, just remove the prefix from your host server name like https or http like
proxy_servers: {http: 127.0.0.1:1080, https: 127.0.0.1:1080}, the reason is here

@RengarWang
Copy link

If you have set proxy-servers in .condarc, just remove the prefix from your host server name like https or http like
proxy_servers: {http: 127.0.0.1:1080, https: 127.0.0.1:1080}, the reason is here

Thank you, this method is useful, it can be used with VPN now.
1、Check your VPN port number first.
2、Add port number in .condarc.(PS:Change 8888 to your port number)
3、pip install urllib3==1.25.11.
1618907852(1)

@tykutar
Copy link
Author

tykutar commented Apr 21, 2021

Thank you, @WMQ1999 and @RengarWang !

Unfortunately, I still encounter an error:

(base) C:\Users\user>pip install urllib3==1.25.11
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection.HTTPSConnection object at 0x0000019E21B81880>, 'Connection to pypi.org timed out. (connect timeout=15)')': /simple/urllib3/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection.HTTPSConnection object at 0x0000019E21B81AC0>, 'Connection to pypi.org timed out. (connect timeout=15)')': /simple/urllib3/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection.HTTPSConnection object at 0x0000019E21B81CA0>, 'Connection to pypi.org timed out. (connect timeout=15)')': /simple/urllib3/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection.HTTPSConnection object at 0x0000019E21B81E80>, 'Connection to pypi.org timed out. (connect timeout=15)')': /simple/urllib3/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection.HTTPSConnection object at 0x0000019E21BAF0A0>, 'Connection to pypi.org timed out. (connect timeout=15)')': /simple/urllib3/
ERROR: Could not find a version that satisfies the requirement urllib3==1.25.11
ERROR: No matching distribution found for urllib3==1.25.11

(base) C:\Users\user>set http_proxy=http://[username]:[password]@[IPaddress]:[port]

(base) C:\Users\user>set https_proxy=https://[username]:[password]@[IPaddress]:[port]

(base) C:\Users\user>pip install urllib3==1.25.11
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1123)'))': /simple/urllib3/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1123)'))': /simple/urllib3/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1123)'))': /simple/urllib3/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1123)'))': /simple/urllib3/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1123)'))': /simple/urllib3/
Could not fetch URL https://pypi.org/simple/urllib3/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/urllib3/ (Caused by SSLError(SSLError(1, '[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1123)'))) - skipping
ERROR: Could not find a version that satisfies the requirement urllib3==1.25.11
ERROR: No matching distribution found for urllib3==1.25.11
Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError(SSLError(1, '[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1123)'))) - skipping
`conda config --show-sources`

==> C:\Users\user\.condarc <==
ssl_verify: True
proxy_servers:
  http: [username]:[password]@[IPaddress]:[port]
  https: [username]:[password]@[IPaddress]:[port]
channel_priority: strict
channels:
  - conda-forge
  - defaults
show_channel_urls: True
report_errors: False

Could it be that it doesn't support username and password?

@RengarWang
Copy link

@tykutar
I did not add username and password,just add like (proxy_servers: {http: 127.0.0.1:8888, https: 127.0.0.1:8888}),you can try it.

@tykutar
Copy link
Author

tykutar commented Apr 21, 2021

@RengarWang , thank you for your advice.
Sadly, still no luck 😥

(base) C:\Users\user>pip install urllib3==1.25.11
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection.HTTPSConnection object at 0x000001B6AC461880>, 'Connection to pypi.org timed out. (connect timeout=15)')': /simple/urllib3/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection.HTTPSConnection object at 0x000001B6AC461AC0>, 'Connection to pypi.org timed out. (connect timeout=15)')': /simple/urllib3/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection.HTTPSConnection object at 0x000001B6AC461CA0>, 'Connection to pypi.org timed out. (connect timeout=15)')': /simple/urllib3/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection.HTTPSConnection object at 0x000001B6AC461E80>, 'Connection to pypi.org timed out. (connect timeout=15)')': /simple/urllib3/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection.HTTPSConnection object at 0x000001B6AC48F0A0>, 'Connection to pypi.org timed out. (connect timeout=15)')': /simple/urllib3/
ERROR: Could not find a version that satisfies the requirement urllib3==1.25.11
ERROR: No matching distribution found for urllib3==1.25.11
`conda config --show-sources`

==> C:\Users\user\.condarc <==
ssl_verify: True
proxy_servers:
  http: [IPaddress]:[port]
  https: [IPaddress]:[port]
channel_priority: strict
channels:
  - conda-forge
  - defaults
show_channel_urls: True
report_errors: False

( *[IPaddress]:[port] represents actual values in my .condarc file.)

@hfjohn123
Copy link

Eh...? what if after I set the proxy I can go smoothly with the prompt, but I still unable to use the Navigator (the same error, ValueError: check_hostname requires server_hostname). Before I set the proxy I even get error from the promt.

@LuomingXu
Copy link

LuomingXu commented Jun 3, 2021

I use VPN and encountered this bug.
After add proxy_servers: {http: 127.0.0.1:1080, https: 127.0.0.1:1080} to .condarc dit not resolve this problem, I just force comment out this code at ssl.py

image

works fine to me. 🤣

Navigator Error
An unexpected error occurred on Navigator start-up

Report
Please report this issue in the anaconda issue tracker

Main Error
check_hostname requires server_hostname
Traceback
Traceback (most recent call last):
  File "C:\ProgramData\Anaconda3\lib\site-packages\anaconda_navigator\exceptions.py", line 72, in exception_handler
    return_value = func(*args, **kwargs)
  File "C:\ProgramData\Anaconda3\lib\site-packages\anaconda_navigator\app\start.py", line 146, in start_app
    window = run_app(splash)
  File "C:\ProgramData\Anaconda3\lib\site-packages\anaconda_navigator\app\start.py", line 65, in run_app
    window = MainWindow(splash=splash)
  File "C:\ProgramData\Anaconda3\lib\site-packages\anaconda_navigator\widgets\main_window.py", line 165, in __init__
    self.api = AnacondaAPI()
  File "C:\ProgramData\Anaconda3\lib\site-packages\anaconda_navigator\api\anaconda_api.py", line 1518, in AnacondaAPI
    ANACONDA_API = _AnacondaAPI()
  File "C:\ProgramData\Anaconda3\lib\site-packages\anaconda_navigator\api\anaconda_api.py", line 83, in __init__
    self._client_api = ClientAPI(config=self.config)
  File "C:\ProgramData\Anaconda3\lib\site-packages\anaconda_navigator\api\client_api.py", line 659, in ClientAPI
    CLIENT_API = _ClientAPI(config=config)
  File "C:\ProgramData\Anaconda3\lib\site-packages\anaconda_navigator\api\client_api.py", line 95, in __init__
    self.reload_client()
  File "C:\ProgramData\Anaconda3\lib\site-packages\anaconda_navigator\api\client_api.py", line 326, in reload_client
    client.user()
  File "C:\ProgramData\Anaconda3\lib\site-packages\binstar_client\__init__.py", line 244, in user
    res = self.session.get(url, verify=self.session.verify)
  File "C:\ProgramData\Anaconda3\lib\site-packages\requests\sessions.py", line 555, in get
    return self.request('GET', url, **kwargs)
  File "C:\ProgramData\Anaconda3\lib\site-packages\requests\sessions.py", line 542, in request
    resp = self.send(prep, **send_kwargs)
  File "C:\ProgramData\Anaconda3\lib\site-packages\requests\sessions.py", line 655, in send
    r = adapter.send(request, **kwargs)
  File "C:\ProgramData\Anaconda3\lib\site-packages\requests\adapters.py", line 439, in send
    resp = conn.urlopen(
  File "C:\ProgramData\Anaconda3\lib\site-packages\urllib3\connectionpool.py", line 696, in urlopen
    self._prepare_proxy(conn)
  File "C:\ProgramData\Anaconda3\lib\site-packages\urllib3\connectionpool.py", line 964, in _prepare_proxy
    conn.connect()
  File "C:\ProgramData\Anaconda3\lib\site-packages\urllib3\connection.py", line 359, in connect
    conn = self._connect_tls_proxy(hostname, conn)
  File "C:\ProgramData\Anaconda3\lib\site-packages\urllib3\connection.py", line 500, in _connect_tls_proxy
    return ssl_wrap_socket(
  File "C:\ProgramData\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:\ProgramData\Anaconda3\lib\site-packages\urllib3\util\ssl_.py", line 474, in _ssl_wrap_socket_impl
    return ssl_context.wrap_socket(sock)
  File "C:\ProgramData\Anaconda3\lib\ssl.py", line 500, in wrap_socket
    return self.sslsocket_class._create(
  File "C:\ProgramData\Anaconda3\lib\ssl.py", line 997, in _create
    raise ValueError("check_hostname requires server_hostname")
ValueError: check_hostname requires server_hostname

@tykutar
Copy link
Author

tykutar commented Jun 4, 2021

Thank you for all your help!
Unfortunately, none worked for me, so I ended up reverting to the previous revision in offline mode, as suggested here.

@tykutar tykutar closed this as completed Jun 4, 2021
@OpenWaygate
Copy link

image

@mickelliu
Copy link

I had the same problem, but I found out that the HTTP proxy setting in Pycharm was set to "No Proxy", and after I put in the setting of my proxy I can "pip install" within Pycharm without any issue.
Not sure if it is applicable to everyone.

@QIN2DIM
Copy link

QIN2DIM commented Jul 14, 2021

Update

EDIT: 2023/03/18

核心解决思路为绕过 TLS in TLS 机制。

  1. 调整 urllib3 版本,即,pip install urllib3==1.25.11,具体原因看 Analysis。
  2. 或调整代理软件配置:
    1)v2rayN v5.36+, 「参数设置 -- 系统代理设置 -- 高级代理设置」选择 http=http://{ip}:{http_port};https=http://{ip}:{http_port}。在「例外」中添加 pypi.tuna.tsinghua.edu.cn; 绕过 pip 清华源的代理请求,如果你使用其他 pip 源,填写相应的域名即可。
    2)Clash(cfw/verge/...)开启 TAP/TUN。
    3)NekoRay v2.1- 切换至 VPN 模式,NekoRay v2.2+ 切换系统高级代理格式,http=http://{ip}:{http_port};https=http://{ip}:{http_port}ip:port

Solution

请尝试按顺序执行如下操作解决此问题:

  1. 通过 conda config --show-sources 指令进入 .condarc 文件,删除关于上文提到的 proxy_servers 的配置;
  2. 关闭本地系统代理后,在当前 Python 编程环境的 Terminal 中运行 pip install urllib3==1.25.11,完成版本调整;
  3. 重启本地系统代理,尝试运行 pip install requests 若未出现报错 ValueError: check_hostname requires server_hostname 则说明 BUG 修复成功。
(env) E:\python_env>pip install requests
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Requirement already satisfied: requests in e:\projectfire\anaconda\envs\v2raycspider1125\lib\site-packages (2.25.1)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in e:\projectfire\anaconda\envs\v2raycspider1125\lib\site-packages (from requests) (1.26.3)
Requirement already satisfied: idna<3,>=2.5 in e:\projectfire\anaconda\envs\v2raycspider1125\lib\site-packages (from requests) (2.10)
Requirement already satisfied: certifi>=2017.4.17 in e:\projectfire\anaconda\envs\v2raycspider1125\lib\site-packages (from requests) (2021.5.30)
Requirement already satisfied: chardet<5,>=3.0.2 in e:\projectfire\anaconda\envs\v2raycspider1125\lib\site-packages (from requests) (4.0.0)

[注意] 若您使用 PyCharm 编辑工程,请在设置中关闭代理。Pycharm 中的代理设置仅对软件本身有效,如插件商店,而诸如通过 conda 创建 python 虚拟环境等操作是通过 shell 实现的,这些流量走系统代理。

Analysis

此部分涉及到的网络通信较为复杂,玩家可能在任何意想不到的场景遇到此报错。

根据栈底上下文判断,个人认为 ValueError 是由 urllib3TLS-in-TLS 代理机制引发的 SSL 接口兼容问题,这个机制是在 urllib3==1.26.0 版本中引入的新特性。而 conda 内建的各种通信类脚手架指令几乎都封装了 urllib3 的库函数,所以我们通过 conda 访问网络有一定概率遇到此报错,这也解释了为何要降低版本号(小于v1.26.0 的最大版本号为 v1.25.11)。

此外,这对中国大陆的开发者来说是一个 New Case(这也是本回答使用中文书写的主要原因)。其他答案有提到用「直连通信」(也即不使用 VPN )的方式绕过TLS-in-TLS,显然,这在访问一些「本就可以直接访问」的站点的情况下是没问题的。但如果我们访问的域名或 IP 已经被墙或污染,我们的直连流量显然会被阻断,这就不得不使用代理了(此段介绍仅是通俗说法,实际情况非常复杂)。

因此,对于国内用户来说,使用不存在 TLS-in-TLS 的版本是一种较为便捷的解决方案。直至目前, urllib3 已经更新到了 v1.26.7 仍没有解决这个潜在的代理问题。

Related Issues

SSLError(SSLEOFError(8, ‘EOF occurred in violation of protocol (_ssl.c:1129)'))

对于国内用户来说,使用 pip install 遇到错误 _SSL.c:1129 ,绝大多数情况下是「 使用了全局代理且配置了 pip 源」。

若您按照 Solution 第三步测试 pip install 指令时遇上了额外的 _SSL.c:1129 报错(也即在开启全局代理的情况下使用 pip 出现了新的报错), 这篇博客 也许可以为你消解疑惑。

@pr0b3r7
Copy link

pr0b3r7 commented Aug 22, 2021

请尝试按顺序执行如下操作解决此问题:

1. 通过`conda config --show-sources`指令进入`.condarc`文件,删除关于**上文提到的**“proxy_servers”的配置;

2. 关闭本地系统代理后,在当前Python编程环境的Terminal中运行`pip install urllib3==1.25.8`,完成版本调整;

3. 重启本地系统代理,尝试运行`pip install requests`若未出现报错`ValueError: check_hostname requires server_hostname`则说明bug修复成功
(env) E:\python_env>pip install requests
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Requirement already satisfied: requests in e:\projectfire\anaconda\envs\v2raycspider1125\lib\site-packages (2.25.1)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in e:\projectfire\anaconda\envs\v2raycspider1125\lib\site-packages (from requests) (1.26.3)
Requirement already satisfied: idna<3,>=2.5 in e:\projectfire\anaconda\envs\v2raycspider1125\lib\site-packages (from requests) (2.10)
Requirement already satisfied: certifi>=2017.4.17 in e:\projectfire\anaconda\envs\v2raycspider1125\lib\site-packages (from requests) (2021.5.30)
Requirement already satisfied: chardet<5,>=3.0.2 in e:\projectfire\anaconda\envs\v2raycspider1125\lib\site-packages (from requests) (4.0.0)

[注意] 若您使用PyCharm编辑工程,请在设置中关闭代理,目前主流代理软件都能成功代理软件流量,无需手动配置
image

This solution (installing urllib3 == 1.25.8) solved my issue reported in: rkhal101/Web-Security-Academy-Series#3

@mickelliu
Copy link

mickelliu commented Sep 3, 2021

I tried all methods mentioned above but couldn't get it to work. I would still get 443 connection timeout in Pycharm or VSCode alike.
Then I tried to set proxy in git global config and it worked.
git config --global http.proxy 127.0.0.1:7890

@JarmoHu
Copy link

JarmoHu commented Sep 30, 2021

proxy_servers:
  http: http://localhost:2334
  https: http://localhost:2334

用"localhost"而不是"127.0.0.1"就好了,也是奇怪

@devakapkk
Copy link

This problem occurs when I connect to the VPN, and there is no problem without the VPN, but my download speed is slow.

Thank you.

@Humble-LiuAo
Copy link

If you have set proxy-servers in .condarc, just remove the prefix from your host server name like https or http like
proxy_servers: {http: 127.0.0.1:1080, https: 127.0.0.1:1080}, the reason is here

Thank you, this method is useful, it can be used with VPN now. 1、Check your VPN port number first. 2、Add port number in .condarc.(PS:Change 8888 to your port number) 3、pip install urllib3==1.25.11. 1618907852(1)

thank you bro ! I solved my problem.
1.
I first updated Anaconda and conda and urllib and all p
2.
ssl_verify:true
show_channel_urls:true
report_errors:false
proxy_servers:{http: 127.0.0.1:xxxx, https: 127.0.0.1:xxxx}

@sky31even
Copy link

请尝试按顺序执行如下操作解决此问题:

  1. 通过conda config --show-sources指令进入.condarc文件,删除关于上文提到的“proxy_servers”的配置;
  2. 关闭本地系统代理后,在当前Python编程环境的Terminal中运行pip install urllib3==1.25.8,完成版本调整;
  3. 重启本地系统代理,尝试运行pip install requests若未出现报错ValueError: check_hostname requires server_hostname则说明bug修复成功
(env) E:\python_env>pip install requests
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Requirement already satisfied: requests in e:\projectfire\anaconda\envs\v2raycspider1125\lib\site-packages (2.25.1)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in e:\projectfire\anaconda\envs\v2raycspider1125\lib\site-packages (from requests) (1.26.3)
Requirement already satisfied: idna<3,>=2.5 in e:\projectfire\anaconda\envs\v2raycspider1125\lib\site-packages (from requests) (2.10)
Requirement already satisfied: certifi>=2017.4.17 in e:\projectfire\anaconda\envs\v2raycspider1125\lib\site-packages (from requests) (2021.5.30)
Requirement already satisfied: chardet<5,>=3.0.2 in e:\projectfire\anaconda\envs\v2raycspider1125\lib\site-packages (from requests) (4.0.0)

[注意] 若您使用PyCharm编辑工程,请在设置中关闭代理,目前主流代理软件都能成功代理软件流量,无需手动配置 image

only this works for me ~~

@Bennett-Yang
Copy link

proxy_servers:
  http: http://localhost:2334
  https: http://localhost:2334

用"localhost"而不是"127.0.0.1"就好了,也是奇怪

This one works for me. Thx

@EachenL
Copy link

EachenL commented Feb 26, 2022

If you have set proxy-servers in .condarc, just remove the prefix from your host server name like https or http like
proxy_servers: {http: 127.0.0.1:1080, https: 127.0.0.1:1080}, the reason is here

Thank you, this method is useful, it can be used with VPN now. 1、Check your VPN port number first. 2、Add port number in .condarc.(PS:Change 8888 to your port number) 3、pip install urllib3==1.25.11. 1618907852(1)

Thank you very much!!! It solves my problem!!! It's important to install urllib3==1.25.11!!!

@sandyowlet
Copy link

proxy_servers:
  http: http://localhost:2334
  https: http://localhost:2334

用"localhost"而不是"127.0.0.1"就好了,也是奇怪

This really works for me!

@mywangxiaojie
Copy link

mywangxiaojie commented Apr 6, 2023

close vpn will works

@github-actions github-actions bot added the locked [bot] locked due to inactivity label Apr 5, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 5, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
locked [bot] locked due to inactivity
Projects
None yet
Development

No branches or pull requests