`pipenv install XYZ` command sometimes hangs indefinitely at "Locking [packages] dependencies"
See original GitHub issueSimilar to these issues:
Summary
When using pipenv install XYZ
, the process hangs indefinitely at “Locking [packages] dependencies”.
This doesn’t happen every time, and may be related to which package is being installed. This morning it is happening every time I try to install tensorflow. Last night it was happening for numpy as well, but today numpy is fine.
The hanged response seems to last indefinitely (though I did manually terminate the process after an hour). The Pipfile.lock is not written, but the Pipfile is written and the expected packages are installed and listed when I run pipenv run pip freeze
.
I was able to reproduce this using various permutations of:
- (L)ubuntu 16.04 and (X)ubuntu 17.10
pipenv --three
andpipenv --two
- pipenv installed through python 2.7 and pipenv installed through python 3.5
- …and I downloaded the pipenv source and installed that in an isolated environment to see if the issue was specific to pipenv version 11.8.3. I experienced the same behavior in 11.9.0.
I am also able to reproduce it by simply running pipenv lock
or pipenv update
if I have tensorflow (or whatever package is currently causing me trouble) listed in my Pipfile.
$ python -m pipenv.help output
Pipenv version: '11.8.3'
Pipenv location: '/home/mary/.local/lib/python2.7/site-packages/pipenv'
Python location: '/usr/bin/python'
Other Python installations in PATH
:
-
2.7
:/usr/bin/python2.7
-
2.7
:/usr/bin/python2.7
-
3.5
:/usr/bin/python3.5m
-
3.5
:/usr/bin/python3.5
-
2.7.12
:/usr/bin/python
-
2.7.12
:/usr/bin/python2
-
3.5.2
:/usr/bin/python3
PEP 508 Information:
{'implementation_name': 'cpython',
'implementation_version': '0',
'os_name': 'posix',
'platform_machine': 'x86_64',
'platform_python_implementation': 'CPython',
'platform_release': '4.13.0-37-generic',
'platform_system': 'Linux',
'platform_version': '#42~16.04.1-Ubuntu SMP Wed Mar 7 16:03:28 UTC 2018',
'python_full_version': '2.7.12',
'python_version': '2.7',
'sys_platform': 'linux2'}
System environment variables:
MANDATORY_PATH
_LXSESSION_PID
XDG_GREETER_DATA_DIR
PROJECT_HOME
LC_CTYPE
PYTHONDONTWRITEBYTECODE
XDG_CURRENT_DESKTOP
XDG_SESSION_TYPE
LOGNAME
XDG_SEAT
PATH
XDG_VTNR
QT_PLATFORM_PLUGIN
PYTHONUNBUFFERED
VIRTUALENVWRAPPER_SCRIPT
ZSH
DISPLAY
SSH_AGENT_PID
LANG
TERM
SHELL
XDG_SESSION_PATH
XAUTHORITY
LANGUAGE
SHLVL
QT_LINUX_ACCESSIBILITY_ALWAYS_ON
QT_QPA_PLATFORMTHEME
SESSION_FOLDER
QT_ACCESSIBILITY
WINDOWID
LIBVIRT_DEFAULT_URI
HOME
XDG_SESSION_DESKTOP
SAL_USE_VCLPLUGIN
XDG_RUNTIME_DIR
WORKON_HOME
SSH_AUTH_SOCK
VTE_VERSION
GDMSESSION
VIRTUALENVWRAPPER_WORKON_CD
XDG_SEAT_PATH
PIP_PYTHON_PATH
XDG_SESSION_ID
DBUS_SESSION_BUS_ADDRESS
_
VIRTUALENVWRAPPER_HOOK_DIR
VIRTUALENVWRAPPER_PROJECT_FILENAME
DESKTOP_SESSION
LSCOLORS
XDG_CONFIG_DIRS
DEFAULTS_PATH
XDG_CONFIG_HOME
OLDPWD
LS_COLORS
GDM_LANG
XDG_DATA_DIRS
PWD
XDG_MENU_PREFIX
LESS
PAGER
USER
Pipenv–specific environment variables:
Debug–specific environment variables:
PATH
:/home/mary/bin:/home/mary/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
SHELL
:/usr/bin/zsh
LANG
:en_US.UTF-8
PWD
:/home/mary/Development/Projects/poor_mans_smart_camera
Contents of Pipfile
(‘/home/mary/Development/Projects/poor_mans_smart_camera/Pipfile’):
[[source]]
url = "https://pypi.python.org/simple"
verify_ssl = true
name = "pypi"
[dev-packages]
[packages]
numpy = "*"
tensorflow = "*"
[requires]
python_version = "3.5"
Expected result
I expect the step in which the Pipfile.lock is generated to take at most a minute.
I have good hardware with lots of free memory and processing power, so I don’t think this is a resource constraint. My internet speed is 60 Mbps, so I doubt it is a networking issue when requesting packages.
Actual result
While this screenshot doesn’t show verbose output like the file above, it does visually demonstrate what I am experiencing.
Steps to replicate
- Spin up new virtualenv using
pipenv --three
orpipenv --two
. - Confirm things are working as expected with a package you know is installing fine such as
pipenv install pylint
. - Now cause it to hang by installing a package that is not working for whatever reason such as
pipenv install tensorflow
.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:29
- Comments:78 (32 by maintainers)
Would it be feasible to display the package that’s currently being locked? I think that would at least help to stop people thinking that Pipenv is hanging.
@uranusjr @techalchemy @jtratner
Holy buckets, Batman! It worked!
Let’s see if this solution works for some of the other people reporting the same issue. @roddds @jlhood @roveo @claytonaalves If you’re still able to reproduce pipenv hanging indefinitely at “Lock… [packages] dependencies”, try clearing your pip (and pipenv?) cache at
~/.cache/.pip
and report back on whether that resolved the issue with pipenv hanging. 😃