question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to lock from private PyPI

See original GitHub issue

I am currently unable to lock my Pipfile when using our private PyPI sources on 2018.11.14. This issue hadn’t appeared on prior versions of pipenv. I suppose it’s possible that our private PyPI sources are the problem, but I’m not sure what could be happening.

This is an example Pipfile that causes the error:

[[source]]
url = "http://<private-pypi-host>/simple/"
verify_ssl = false
name = "private-pypi"

[packages]
moto = "==1.3.6"

[dev-packages]

[requires]

Running pipenv install yields the following logs:

Creating a virtualenv for this project…
Pipfile: /Pipfile
Using /usr/local/bin/python (3.7.1) to create virtualenv…
✔ Complete 
Already using interpreter /usr/local/bin/python
Using base prefix '/usr/local'
New python executable in /root/.local/share/virtualenvs/-x-v5uFv0/bin/python
Installing setuptools, pip, wheel...
done.
Virtualenv location: /root/.local/share/virtualenvs/-x-v5uFv0
Pipfile.lock not found, creating…
Locking [dev-packages] dependencies…
Locking [packages] dependencies…
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/pipenv/vendor/pexpect/expect.py", line 109, in expect_loop
    return self.timeout()
  File "/usr/local/lib/python3.7/site-packages/pipenv/vendor/pexpect/expect.py", line 82, in timeout
    raise TIMEOUT(msg)
pexpect.exceptions.TIMEOUT: <pexpect.popen_spawn.PopenSpawn object at 0x7f85959d7f98>
searcher: searcher_re:
    0: re.compile('\n')

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/bin/pipenv", line 11, in <module>
    sys.exit(cli())
  File "/usr/local/lib/python3.7/site-packages/pipenv/vendor/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/pipenv/vendor/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.7/site-packages/pipenv/vendor/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.7/site-packages/pipenv/vendor/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.7/site-packages/pipenv/vendor/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/pipenv/vendor/click/decorators.py", line 64, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/pipenv/vendor/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/pipenv/vendor/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/pipenv/cli/command.py", line 249, in install
    editable_packages=state.installstate.editables,
  File "/usr/local/lib/python3.7/site-packages/pipenv/core.py", line 1872, in do_install
    keep_outdated=keep_outdated
  File "/usr/local/lib/python3.7/site-packages/pipenv/core.py", line 1223, in do_init
    pypi_mirror=pypi_mirror,
  File "/usr/local/lib/python3.7/site-packages/pipenv/core.py", line 1047, in do_lock
    lockfile=lockfile
  File "/usr/local/lib/python3.7/site-packages/pipenv/utils.py", line 620, in venv_resolve_deps
    c = resolve(cmd, sp)
  File "/usr/local/lib/python3.7/site-packages/pipenv/utils.py", line 503, in resolve
    result = c.expect(u"\n", timeout=environments.PIPENV_TIMEOUT)
  File "/usr/local/lib/python3.7/site-packages/pipenv/vendor/delegator.py", line 215, in expect
    self.subprocess.expect(pattern=pattern, timeout=timeout)
  File "/usr/local/lib/python3.7/site-packages/pipenv/vendor/pexpect/spawnbase.py", line 341, in expect
    timeout, searchwindowsize, async_)
  File "/usr/local/lib/python3.7/site-packages/pipenv/vendor/pexpect/spawnbase.py", line 369, in expect_list
    return exp.expect_loop(timeout)
  File "/usr/local/lib/python3.7/site-packages/pipenv/vendor/pexpect/expect.py", line 119, in expect_loop
    return self.timeout(e)
  File "/usr/local/lib/python3.7/site-packages/pipenv/vendor/pexpect/expect.py", line 82, in timeout
    raise TIMEOUT(msg)
pexpect.exceptions.TIMEOUT: <pexpect.popen_spawn.PopenSpawn object at 0x7f85959d7f98>
searcher: searcher_re:
    0: re.compile('\n')
<pexpect.popen_spawn.PopenSpawn object at 0x7f85959d7f98>
searcher: searcher_re:
    0: re.compile('\n')

Replacing the [[source]] section with the default appears to resolve the issue, but then I’m unable to install private pips.


$ pipenv --support

Pipenv version: '2018.11.14'

Pipenv location: '/usr/local/lib/python3.7/site-packages/pipenv'

Python location: '/usr/local/bin/python'

Python installations found:

  • 3.7.1: /usr/local/bin/python
  • 3.7.1: /usr/local/bin/python3.7m
  • 3.5.3: /usr/bin/python3.5
  • 3.5.3: /usr/bin/python3.5m
  • 2.7.13: /usr/bin/python

PEP 508 Information:

{'implementation_name': 'cpython',
 'implementation_version': '3.7.1',
 'os_name': 'posix',
 'platform_machine': 'x86_64',
 'platform_python_implementation': 'CPython',
 'platform_release': '4.9.93-linuxkit-aufs',
 'platform_system': 'Linux',
 'platform_version': '#1 SMP Wed Jun 6 16:55:56 UTC 2018',
 'python_full_version': '3.7.1',
 'python_version': '3.7',
 'sys_platform': 'linux'}

System environment variables:

  • PATH
  • HOSTNAME
  • TERM
  • LANG
  • GPG_KEY
  • PYTHON_VERSION
  • PYTHON_PIP_VERSION
  • HOME
  • PIP_DISABLE_PIP_VERSION_CHECK
  • PYTHONDONTWRITEBYTECODE
  • PIP_SHIMS_BASE_MODULE
  • PIP_PYTHON_PATH
  • PYTHONFINDER_IGNORE_UNSUPPORTED

Pipenv–specific environment variables:

Debug–specific environment variables:

  • PATH: /usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
  • LANG: C.UTF-8

Contents of Pipfile (‘/Pipfile’):

[[source]]
url = "http://public-pypi.service.dc1.consul/simple/"
verify_ssl = false
name = "public-pypi"

[packages]
moto = "==1.3.6"

[dev-packages]

[requires]

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:10
  • Comments:22 (10 by maintainers)

github_iconTop GitHub Comments

6reactions
amancevicecommented, Nov 19, 2018

aha, setting PIPENV_TIMEOUT=3600 seems to resolve the issue!

So if it’s timing out, perhaps a better error message could be printed to let the user know that’s what is happening?

2reactions
astrojuanlucommented, Nov 21, 2018

I had this same traceback with a plain pipenv install ipyleaflet (first usage) and, when I ran again the command using PIPENV_TIMEOUT=3600, it worked. Just in case it’s useful for anybody else.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Pipenv: I can install from PyPI private using skip-lock only
I have python package in a private PyPI in Azure. I want to install it in other project, but it only works with...
Read more >
pipenv Changelog - pyup.io
Pipefile with unnamed package indecies will fail to lock. ... Resolved an issue parsing usernames from private PyPI URIs in `Pipfiles` by updating...
Read more >
pipenv Documentation - Read the Docs
PyPI and their private projects—which is our recommended best practice.” The above documentation holds true for both lock resolution and sync of packages....
Read more >
Private package support - Renovate Docs
Resolving private config presets; Looking up dependency versions; Looking up release notes; Passing to package managers when updating lock files or ...
Read more >
aws-cdk.aws-lambda-python-alpha - PyPI
lock with the associated pyproject.toml at the entry path, then PythonLayerVersion will include the dependencies inline with your code in the layer. Define...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found