pipenv: Unable to lock from private PyPI
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]
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 10
- Comments: 22 (10 by maintainers)
Commits related to this issue
- Fix accidentally-shortened installation timeouts - Fixes #3244 Signed-off-by: Dan Ryan <dan@danryan.co> — committed to pypa/pipenv by techalchemy 6 years ago
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?
I had this same traceback with a plain
pipenv install ipyleaflet
(first usage) and, when I ran again the command usingPIPENV_TIMEOUT=3600
, it worked. Just in case it’s useful for anybody else.Thanks for your patience and for the helpful debugging information— hopefully the changes are actually improving the UX overall
For the whole
Pipfile
(which I won’t paste here because it’s mostly private pips):I notice in the stacktrace that
pipenv/utils.py
is the last non-vendor’d file in there, which looks like it got considerable changes between the latest version and the one prior.Aha! After almost seven minutes,
pipenv-resolver
did result in some output, and since then I canpipenv lock
andpipenv install
again. Sorry to have bothered you…