Pipenv ReadTimeoutError in WSL Environment

463 views Asked by At

I am using, Python 3.8.2 (default, Jul 16 2020, 14:00:26) [GCC 9.3.0] on WSL

Pipfile

[[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"

Error

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)"))

Question

Above "pipenv install" command works for me in Windows Environment.

When I tried the same with WSL its ending up with "ReadTimeoutError".

I tried "ping pypi.org" in WSL and I am getting ping response as expected.

I don't know why I am facing above issue. No idea on what piece I am missing in WSL side. I also tried modifying inbound and outbound rules to allow python3 and pipenv in Windows Firewall rules. No luck either. My corporate network doesn't have any proxy_server configured as well.

Any help here is much appreciated. Thanks

0

There are 0 answers