2

我在 WSL 上使用 Python 3.8.2(默认,2020 年 7 月 16 日,14:00:26)[GCC 9.3.0]

点文件

[[source]]
name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true

[dev-packages]
autopep8 = "*"
pylint = "*"
rope = "*"

[packages]
requests = "*"
ldap3 = "*"
pycryptodome = "*"
sqlalchemy = "*"
pyjwt = "*"
jira = "*"

[requires]
python_version = "3.7"

错误

Pipfile.lock not found, creating…
Locking [dev-packages] dependencies…
ring handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/pipenv/resolver.py", line 82, in <module>
    main()
  File "/usr/lib/python3/dist-packages/pipenv/resolver.py", line 66, in main
    results = resolve(
  File "/usr/lib/python3/dist-packages/pipenv/resolver.py", line 56, in resolve
    return pipenv.utils.resolve_deps(
  File "/usr/lib/python3/dist-packages/pipenv/utils.py", line 417, in resolve_deps
    resolved_tree, resolver = actually_resolve_reps(
  File "/usr/lib/python3/dist-packages/pipenv/utils.py", line 336, in actually_resolve_reps
    resolved_tree.update(resolver.resolve(max_rounds=PIPENV_MAX_ROUNDS))
  File "/usr/lib/python3/dist-packages/pipenv/patched/piptools/resolver.py", line 102, in resolve
    has_changed, best_matches = self._resolve_one_round()
  File "/usr/lib/python3/dist-packages/pipenv/patched/piptools/resolver.py", line 193, in _resolve_one_round
    best_matches = {self.get_best_match(ireq) for ireq in constraints}
  File "/usr/lib/python3/dist-packages/pipenv/patched/piptools/resolver.py", line 193, in <setcomp>
    best_matches = {self.get_best_match(ireq) for ireq in constraints}
  File "/usr/lib/python3/dist-packages/pipenv/patched/piptools/resolver.py", line 257, in get_best_match
    best_match = self.repository.find_best_match(ireq, prereleases=self.prereleases)
  File "/usr/lib/python3/dist-packages/pipenv/patched/piptools/repositories/pypi.py", line 116, in find_best_match
    all_candidates = self.find_all_candidates(ireq.name)
  File "/usr/lib/python3/dist-packages/pipenv/patched/piptools/repositories/pypi.py", line 101, in find_all_candidates
    candidates = self.finder.find_all_candidates(req_name)
  File "/usr/lib/python3/dist-packages/pipenv/patched/notpip/index.py", line 456, in find_all_candidates
    for page in self._get_pages(url_locations, project_name):
  File "/usr/lib/python3/dist-packages/pipenv/patched/notpip/index.py", line 606, in _get_pages
    page = self._get_page(location)
  File "/usr/lib/python3/dist-packages/pipenv/patched/notpip/index.py", line 722, in _get_page
    return HTMLPage.get_page(link, session=self.session)
  File "/usr/lib/python3/dist-packages/pipenv/patched/notpip/index.py", line 827, in get_page
    resp = session.get(
  File "/usr/lib/python3/dist-packages/pipenv/vendor/pip9/_vendor/requests/sessions.py", line 488, in get
    return self.request('GET', url, **kwargs)
  File "/usr/lib/python3/dist-packages/pipenv/vendor/pip9/download.py", line 386, in request
    return super(PipSession, self).request(method, url, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/pipenv/vendor/pip9/_vendor/requests/sessions.py", line 475, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/lib/python3/dist-packages/pipenv/vendor/pip9/_vendor/requests/sessions.py", line 596, in send
    r = adapter.send(request, **kwargs)
  File "/usr/lib/python3/dist-packages/pipenv/vendor/pip9/_vendor/cachecontrol/adapter.py", line 47, in send
    resp = super(CacheControlAdapter, self).send(request, **kw)
  File "/usr/lib/python3/dist-packages/pipenv/vendor/pip9/_vendor/requests/adapters.py", line 487, in send
    raise ConnectionError(e, request=request)
pip9._vendor.requests.exceptions.ConnectionError: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/autopep8/ (Caused by ReadTimeoutError("HTTPSConnectionPool(host='pypi.org', port=443): Read timed out. (read timeout=15)"))

问题

上面的“pipenv install”命令在 Windows 环境中对我有用。

当我对 WSL 进行相同尝试时,它以“ReadTimeoutError”结束。

我在 WSL 中尝试了“ping pypi.org”,并且得到了预期的 ping 响应。

我不知道为什么我面临上述问题。不知道我在 WSL 方面缺少什么。我还尝试修改入站和出站规则以在 Windows 防火墙规则中允许 python3 和 pipenv。也没有运气。我的公司网络也没有配置任何 proxy_server。

非常感谢这里的任何帮助。谢谢

4

0 回答 0