首页 > 解决方案 > 为什么我与 repo.anacoda.com 的连接失败?

问题描述

当我尝试在 Windows 上使用命令提示符在 Anaconda 中设置虚拟环境时,输入后出现以下错误 conda create -n tensorflow python=3.8

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'

这是调试日志:

DEBUG conda.core.solve:solve_final_state(220): solving prefix C:\Users\sande\anaconda3\envs\tensorflow
  specs_to_remove: frozenset()
  specs_to_add: frozenset({MatchSpec("python=3.5")})
  prune: <auxlib._Null object at 0x0000023152F7B6D0>
Collecting package metadata (current_repodata.json): ...working... TRACE conda.gateways.disk.test:file_path_is_writable(25): checking path is writable C:\Users\sande\anaconda3\pkgs\urls.txt
DEBUG conda.core.package_cache_data:_check_writable(259): package cache directory 'C:\Users\sande\anaconda3\pkgs' writable: True
DEBUG conda.core.subdir_data:_load(201): No local cache found for https://repo.anaconda.com/pkgs/main/win-64/current_repodata.json at C:\Users\sande\anaconda3\pkgs\cache\9b8cd901.json
DEBUG conda.core.subdir_data:_load(201): No local cache found for https://repo.anaconda.com/pkgs/r/win-64/current_repodata.json at C:\Users\sande\anaconda3\pkgs\cache\a9664645.json
DEBUG conda.core.subdir_data:_load(201): No local cache found for https://repo.anaconda.com/pkgs/main/noarch/current_repodata.json at C:\Users\sande\anaconda3\pkgs\cache\b35683e8.json
DEBUG conda.core.subdir_data:_load(201): No local cache found for https://repo.anaconda.com/pkgs/r/noarch/current_repodata.json at C:\Users\sande\anaconda3\pkgs\cache\227b7582.json
DEBUG conda.core.subdir_data:_load(201): No local cache found for https://repo.anaconda.com/pkgs/msys2/win-64/current_repodata.json at C:\Users\sande\anaconda3\pkgs\cache\1394f696.json
DEBUG conda.core.subdir_data:_load(201): No local cache found for https://repo.anaconda.com/pkgs/msys2/noarch/current_repodata.json at C:\Users\sande\anaconda3\pkgs\cache\e915db84.json
DEBUG urllib3.connectionpool:_new_conn(937): Starting new HTTPS connection (1): repo.anaconda.com:443
DEBUG urllib3.connectionpool:_new_conn(937): Starting new HTTPS connection (1): repo.anaconda.com:443
DEBUG urllib3.connectionpool:_new_conn(937): Starting new HTTPS connection (1): repo.anaconda.com:443
DEBUG urllib3.connectionpool:_new_conn(937): Starting new HTTPS connection (1): repo.anaconda.com:443
DEBUG urllib3.connectionpool:_new_conn(937): Starting new HTTPS connection (1): repo.anaconda.com:443
DEBUG urllib3.connectionpool:_new_conn(937): Starting new HTTPS connection (1): repo.anaconda.com:443
DEBUG urllib3.util.retry:increment(441): Incremented Retry for (url='/pkgs/r/noarch/current_repodata.json'): Retry(total=2, connect=None, read=None, redirect=None, status=None)
WARNING urllib3.connectionpool:urlopen(749): Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1108)'))': /pkgs/r/noarch/current_repodata.json
DEBUG urllib3.util.retry:increment(441): Incremented Retry for (url='/pkgs/msys2/win-64/current_repodata.json'): Retry(total=2, connect=None, read=None, redirect=None, status=None)
DEBUG urllib3.util.retry:increment(441): Incremented Retry for (url='/pkgs/main/win-64/current_repodata.json'): Retry(total=2, connect=None, read=None, redirect=None, status=None)
DEBUG urllib3.util.retry:increment(441): Incremented Retry for (url='/pkgs/r/win-64/current_repodata.json'): Retry(total=2, connect=None, read=None, redirect=None, status=None)
DEBUG urllib3.connectionpool:_new_conn(937): Starting new HTTPS connection (2): repo.anaconda.com:443
DEBUG urllib3.util.retry:increment(441): Incremented Retry for (url='/pkgs/msys2/noarch/current_repodata.json'): Retry(total=2, connect=None, read=None, redirect=None, status=None)
DEBUG urllib3.util.retry:increment(441): Incremented Retry for (url='/pkgs/main/noarch/current_repodata.json'): Retry(total=2, connect=None, read=None, redirect=None, status=None)
WARNING urllib3.connectionpool:urlopen(749): Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1108)'))': /pkgs/msys2/win-64/current_repodata.json
WARNING urllib3.connectionpool:urlopen(749): Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1108)'))': /pkgs/main/win-64/current_repodata.json
WARNING urllib3.connectionpool:urlopen(749): Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1108)'))': /pkgs/r/win-64/current_repodata.json
WARNING urllib3.connectionpool:urlopen(749): Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1108)'))': /pkgs/msys2/noarch/current_repodata.json
WARNING urllib3.connectionpool:urlopen(749): Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1108)'))': /pkgs/main/noarch/current_repodata.json
DEBUG urllib3.connectionpool:_new_conn(937): Starting new HTTPS connection (2): repo.anaconda.com:443
DEBUG urllib3.connectionpool:_new_conn(937): Starting new HTTPS connection (2): repo.anaconda.com:443
DEBUG urllib3.connectionpool:_new_conn(937): Starting new HTTPS connection (2): repo.anaconda.com:443
DEBUG urllib3.connectionpool:_new_conn(937): Starting new HTTPS connection (2): repo.anaconda.com:443
DEBUG urllib3.connectionpool:_new_conn(937): Starting new HTTPS connection (2): repo.anaconda.com:443
DEBUG urllib3.util.retry:increment(441): Incremented Retry for (url='/pkgs/r/noarch/current_repodata.json'): Retry(total=1, connect=None, read=None, redirect=None, status=None)
DEBUG urllib3.util.retry:increment(441): Incremented Retry for (url='/pkgs/r/win-64/current_repodata.json'): Retry(total=1, connect=None, read=None, redirect=None, status=None)
DEBUG urllib3.util.retry:increment(441): Incremented Retry for (url='/pkgs/msys2/win-64/current_repodata.json'): Retry(total=1, connect=None, read=None, redirect=None, status=None)
DEBUG urllib3.util.retry:increment(441): Incremented Retry for (url='/pkgs/main/win-64/current_repodata.json'): Retry(total=1, connect=None, read=None, redirect=None, status=None)
DEBUG urllib3.util.retry:increment(441): Incremented Retry for (url='/pkgs/main/noarch/current_repodata.json'): Retry(total=1, connect=None, read=None, redirect=None, status=None)
DEBUG urllib3.util.retry:increment(441): Incremented Retry for (url='/pkgs/msys2/noarch/current_repodata.json'): Retry(total=1, connect=None, read=None, redirect=None, status=None)
WARNING urllib3.connectionpool:urlopen(749): Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1108)'))': /pkgs/r/noarch/current_repodata.json
DEBUG urllib3.connectionpool:_new_conn(937): Starting new HTTPS connection (3): repo.anaconda.com:443
WARNING urllib3.connectionpool:urlopen(749): Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1108)'))': /pkgs/r/win-64/current_repodata.json
DEBUG urllib3.connectionpool:_new_conn(937): Starting new HTTPS connection (3): repo.anaconda.com:443
WARNING urllib3.connectionpool:urlopen(749): Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1108)'))': /pkgs/msys2/win-64/current_repodata.json
DEBUG urllib3.connectionpool:_new_conn(937): Starting new HTTPS connection (3): repo.anaconda.com:443
WARNING urllib3.connectionpool:urlopen(749): Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1108)'))': /pkgs/main/win-64/current_repodata.json
DEBUG urllib3.connectionpool:_new_conn(937): Starting new HTTPS connection (3): repo.anaconda.com:443
WARNING urllib3.connectionpool:urlopen(749): Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1108)'))': /pkgs/main/noarch/current_repodata.json
DEBUG urllib3.connectionpool:_new_conn(937): Starting new HTTPS connection (3): repo.anaconda.com:443
WARNING urllib3.connectionpool:urlopen(749): Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1108)'))': /pkgs/msys2/noarch/current_repodata.json
DEBUG urllib3.connectionpool:_new_conn(937): Starting new HTTPS connection (3): repo.anaconda.com:443
DEBUG urllib3.util.retry:increment(441): Incremented Retry for (url='/pkgs/r/win-64/current_repodata.json'): Retry(total=0, connect=None, read=None, redirect=None, status=None)
DEBUG urllib3.util.retry:increment(441): Incremented Retry for (url='/pkgs/msys2/win-64/current_repodata.json'): Retry(total=0, connect=None, read=None, redirect=None, status=None)
DEBUG urllib3.util.retry:increment(441): Incremented Retry for (url='/pkgs/main/win-64/current_repodata.json'): Retry(total=0, connect=None, read=None, redirect=None, status=None)
DEBUG urllib3.util.retry:increment(441): Incremented Retry for (url='/pkgs/main/noarch/current_repodata.json'): Retry(total=0, connect=None, read=None, redirect=None, status=None)
DEBUG urllib3.util.retry:increment(441): Incremented Retry for (url='/pkgs/r/noarch/current_repodata.json'): Retry(total=0, connect=None, read=None, redirect=None, status=None)
DEBUG urllib3.util.retry:increment(441): Incremented Retry for (url='/pkgs/msys2/noarch/current_repodata.json'): Retry(total=0, connect=None, read=None, redirect=None, status=None)
WARNING urllib3.connectionpool:urlopen(749): Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1108)'))': /pkgs/r/win-64/current_repodata.json
WARNING urllib3.connectionpool:urlopen(749): Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1108)'))': /pkgs/msys2/win-64/current_repodata.json
DEBUG urllib3.connectionpool:_new_conn(937): Starting new HTTPS connection (4): repo.anaconda.com:443
DEBUG urllib3.connectionpool:_new_conn(937): Starting new HTTPS connection (4): repo.anaconda.com:443
WARNING urllib3.connectionpool:urlopen(749): Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1108)'))': /pkgs/main/win-64/current_repodata.json
DEBUG urllib3.connectionpool:_new_conn(937): Starting new HTTPS connection (4): repo.anaconda.com:443
WARNING urllib3.connectionpool:urlopen(749): Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1108)'))': /pkgs/main/noarch/current_repodata.json
DEBUG urllib3.connectionpool:_new_conn(937): Starting new HTTPS connection (4): repo.anaconda.com:443
WARNING urllib3.connectionpool:urlopen(749): Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1108)'))': /pkgs/r/noarch/current_repodata.json
DEBUG urllib3.connectionpool:_new_conn(937): Starting new HTTPS connection (4): repo.anaconda.com:443
WARNING urllib3.connectionpool:urlopen(749): Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1108)'))': /pkgs/msys2/noarch/current_repodata.json
DEBUG urllib3.connectionpool:_new_conn(937): Starting new HTTPS connection (4): repo.anaconda.com:443
failed
Traceback (most recent call last):
  File "C:\Users\sande\anaconda3\lib\site-packages\urllib3\connectionpool.py", line 670, in urlopen
    httplib_response = self._make_request(
  File "C:\Users\sande\anaconda3\lib\site-packages\urllib3\connectionpool.py", line 381, in _make_request
    self._validate_conn(conn)
  File "C:\Users\sande\anaconda3\lib\site-packages\urllib3\connectionpool.py", line 976, in _validate_conn
    conn.connect()
  File "C:\Users\sande\anaconda3\lib\site-packages\urllib3\connection.py", line 361, in connect
    self.sock = ssl_wrap_socket(
  File "C:\Users\sande\anaconda3\lib\site-packages\urllib3\util\ssl_.py", line 377, in ssl_wrap_socket
    return context.wrap_socket(sock, server_hostname=server_hostname)
  File "C:\Users\sande\anaconda3\lib\ssl.py", line 500, in wrap_socket
    return self.sslsocket_class._create(
  File "C:\Users\sande\anaconda3\lib\ssl.py", line 1040, in _create
    self.do_handshake()
  File "C:\Users\sande\anaconda3\lib\ssl.py", line 1309, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1108)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\sande\anaconda3\lib\site-packages\requests\adapters.py", line 439, in send
    resp = conn.urlopen(
  File "C:\Users\sande\anaconda3\lib\site-packages\urllib3\connectionpool.py", line 752, in urlopen
    return self.urlopen(
  File "C:\Users\sande\anaconda3\lib\site-packages\urllib3\connectionpool.py", line 752, in urlopen
    return self.urlopen(
  File "C:\Users\sande\anaconda3\lib\site-packages\urllib3\connectionpool.py", line 752, in urlopen
    return self.urlopen(
  File "C:\Users\sande\anaconda3\lib\site-packages\urllib3\connectionpool.py", line 724, in urlopen
    retries = retries.increment(
  File "C:\Users\sande\anaconda3\lib\site-packages\urllib3\util\retry.py", line 439, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='repo.anaconda.com', port=443): Max retries exceeded with url: /pkgs/main/win-64/current_repodata.json (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1108)')))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\sande\anaconda3\lib\site-packages\conda\core\subdir_data.py", line 484, in fetch_repodata_remote_request
    resp = session.get(join_url(url, filename), headers=headers, proxies=session.proxies,
  File "C:\Users\sande\anaconda3\lib\site-packages\requests\sessions.py", line 543, in get
    return self.request('GET', url, **kwargs)
  File "C:\Users\sande\anaconda3\lib\site-packages\requests\sessions.py", line 530, in request
    resp = self.send(prep, **send_kwargs)
  File "C:\Users\sande\anaconda3\lib\site-packages\requests\sessions.py", line 643, in send
    r = adapter.send(request, **kwargs)
  File "C:\Users\sande\anaconda3\lib\site-packages\requests\adapters.py", line 514, in send
    raise SSLError(e, request=request)
requests.exceptions.SSLError: HTTPSConnectionPool(host='repo.anaconda.com', port=443): Max retries exceeded with url: /pkgs/main/win-64/current_repodata.json (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1108)')))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\sande\anaconda3\lib\site-packages\conda\exceptions.py", line 1079, in __call__
    return func(*args, **kwargs)
  File "C:\Users\sande\anaconda3\lib\site-packages\conda\cli\main.py", line 84, in _main
    exit_code = do_call(args, p)
  File "C:\Users\sande\anaconda3\lib\site-packages\conda\cli\conda_argparse.py", line 82, in do_call
    return getattr(module, func_name)(args, parser)
  File "C:\Users\sande\anaconda3\lib\site-packages\conda\cli\main_create.py", line 37, in execute
    install(args, parser, 'create')
  File "C:\Users\sande\anaconda3\lib\site-packages\conda\cli\install.py", line 261, in install
    unlink_link_transaction = solver.solve_for_transaction(
  File "C:\Users\sande\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\sande\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\sande\anaconda3\lib\site-packages\conda\core\solve.py", line 262, in solve_final_state
    ssc = self._collect_all_metadata(ssc)
  File "C:\Users\sande\anaconda3\lib\site-packages\conda\common\io.py", line 88, in decorated
    return f(*args, **kwds)
  File "C:\Users\sande\anaconda3\lib\site-packages\conda\core\solve.py", line 415, in _collect_all_metadata
    index, r = self._prepare(prepared_specs)
  File "C:\Users\sande\anaconda3\lib\site-packages\conda\core\solve.py", line 1010, in _prepare
    reduced_index = get_reduced_index(self.prefix, self.channels,
  File "C:\Users\sande\anaconda3\lib\site-packages\conda\core\index.py", line 227, in get_reduced_index
    new_records = SubdirData.query_all(spec, channels=channels, subdirs=subdirs,
  File "C:\Users\sande\anaconda3\lib\site-packages\conda\core\subdir_data.py", line 105, in query_all
    result = tuple(concat(executor.map(subdir_query, channel_urls)))
  File "C:\Users\sande\anaconda3\lib\concurrent\futures\_base.py", line 611, in result_iterator
    yield fs.pop().result()
  File "C:\Users\sande\anaconda3\lib\concurrent\futures\_base.py", line 439, in result
    return self.__get_result()
  File "C:\Users\sande\anaconda3\lib\concurrent\futures\_base.py", line 388, in __get_result
    raise self._exception
  File "C:\Users\sande\anaconda3\lib\concurrent\futures\thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "C:\Users\sande\anaconda3\lib\site-packages\conda\core\subdir_data.py", line 97, in <lambda>
    subdir_query = lambda url: tuple(SubdirData(Channel(url), repodata_fn=repodata_fn).query(
  File "C:\Users\sande\anaconda3\lib\site-packages\conda\core\subdir_data.py", line 110, in query
    self.load()
  File "C:\Users\sande\anaconda3\lib\site-packages\conda\core\subdir_data.py", line 174, in load
    _internal_state = self._load()
  File "C:\Users\sande\anaconda3\lib\site-packages\conda\core\subdir_data.py", line 244, in _load
    raw_repodata_str = fetch_repodata_remote_request(
  File "C:\Users\sande\anaconda3\lib\site-packages\conda\core\subdir_data.py", line 589, in fetch_repodata_remote_request
    raise CondaHTTPError(help_message,
conda.exceptions.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'

知道是什么限制了命令提示符对 URL 的访问吗?编辑:

  1. 我发布了调试日志。
  2. 我尝试改用 Anaconda Prompt。
  3. 我尝试从浏览器访问 URL(它有效)

标签: pythonanaconda

解决方案


您可以尝试从 anaconda navigator 设置环境。那应该对你有用。此外,请查看此内容以获得进一步的帮助。


推荐阅读