pipenv: Pipenv lock hangs
Issue description
Run pipenv lock. Wait for an hour without visible progress
Expected result
Pipenv locks in reasonable time
Actual result
When possible, provide the verbose output (--verbose), especially for locking and dependencies resolving issues.
$ pipenv lock --verbose
Courtesy Notice: Pipenv found itself running within a virtual environment, so it will automatically use that environment, instead of creating its own for any project. You can set PIPENV_IGNORE_VIRTUALENVS=1 to force pipenv to ignore that environment and create its own instead.
Locking [dev-packages] dependencies...
using sources: [{'url': 'https://pypi.org/simple', 'verify_ssl': True, 'name': 'pypi'}]
Using pip: -i https://pypi.org/simple
ROUND 1
Current constraints:
httpie (from -r /tmp/pipenv-zzh9cqpj-requirements/pipenv-r5vz8p2t-constraints.txt (line 2))
Finding the best candidates:
found candidate httpie==0.9.9 (constraint was <any>)
Finding secondary dependencies:
httpie==0.9.9 requires certifi>=2017.4.17, chardet<3.1.0,>=3.0.2, httpie==0.9.9; python_version != "3.3.*" and python_version != "3.1.*" and python_version != "3.0.*" and python_version >= "2.6" and python_version != "3.2.*" and python_version < "4", idna<2.8,>=2.5, pygments>=2.1.3, requests>=2.11.0, urllib3<1.24,>=1.21.1
New dependencies found in this round:
adding ['certifi', '>=2017.4.17', '[]']
adding ['chardet', '<3.1.0,>=3.0.2', '[]']
adding ['httpie', '==0.9.9', '[]']
adding ['idna', '<2.8,>=2.5', '[]']
adding ['pygments', '>=2.1.3', '[]']
adding ['requests', '>=2.11.0', '[]']
adding ['urllib3', '<1.24,>=1.21.1', '[]']
Removed dependencies in this round:
Unsafe dependencies in this round:
------------------------------------------------------------
Result of round 1: not stable
ROUND 2
Current constraints:
certifi>=2017.4.17
chardet<3.1.0,>=3.0.2
httpie==0.9.9 (from -r /tmp/pipenv-zzh9cqpj-requirements/pipenv-r5vz8p2t-constraints.txt (line 2))
idna<2.8,>=2.5
pygments>=2.1.3
requests>=2.11.0
urllib3<1.24,>=1.21.1
Finding the best candidates:
found candidate certifi==2018.4.16 (constraint was >=2017.4.17)
found candidate chardet==3.0.4 (constraint was >=3.0.2,<3.1.0)
found candidate httpie==0.9.9 (constraint was ==0.9.9)
found candidate idna==2.7 (constraint was >=2.5,<2.8)
found candidate pygments==2.2.0 (constraint was >=2.1.3)
found candidate requests==2.19.1 (constraint was >=2.11.0)
found candidate urllib3==1.23 (constraint was >=1.21.1,<1.24)
Finding secondary dependencies:
idna==2.7 requires idna==2.7
httpie==0.9.9 requires certifi>=2017.4.17, chardet<3.1.0,>=3.0.2, httpie==0.9.9; python_version != "3.3.*" and python_version != "3.1.*" and python_version != "3.0.*" and python_version >= "2.6" and python_version != "3.2.*" and python_version < "4", idna<2.8,>=2.5, pygments>=2.1.3, requests>=2.11.0, urllib3<1.24,>=1.21.1
certifi==2018.4.16 requires -
requests==2.19.1 requires certifi>=2017.4.17, chardet<3.1.0,>=3.0.2, idna<2.8,>=2.5, requests==2.19.1; python_version != "3.3.*" and python_version != "3.1.*" and python_version != "3.0.*" and python_version >= "2.6" and python_version != "3.2.*" and python_version < "4", urllib3<1.24,>=1.21.1
chardet==3.0.4 requires -
urllib3==1.23 requires urllib3==1.23; python_version != "3.3.*" and python_version != "3.1.*" and python_version != "3.0.*" and python_version >= "2.6" and python_version != "3.2.*" and python_version < "4"
pygments==2.2.0 requires -
New dependencies found in this round:
adding ['idna', '<2.8,==2.7,>=2.5', '[]']
adding ['requests', '==2.19.1,>=2.11.0', '[]']
adding ['urllib3', '<1.24,==1.23,>=1.21.1', '[]']
Removed dependencies in this round:
removing ['idna', '<2.8,>=2.5', '[]']
removing ['requests', '>=2.11.0', '[]']
removing ['urllib3', '<1.24,>=1.21.1', '[]']
Unsafe dependencies in this round:
------------------------------------------------------------
Result of round 2: not stable
ROUND 3
Current constraints:
certifi>=2017.4.17
chardet<3.1.0,>=3.0.2
httpie==0.9.9 (from -r /tmp/pipenv-zzh9cqpj-requirements/pipenv-r5vz8p2t-constraints.txt (line 2))
idna<2.8,==2.7,>=2.5
pygments>=2.1.3
requests==2.19.1,>=2.11.0
urllib3<1.24,==1.23,>=1.21.1
Finding the best candidates:
found candidate certifi==2018.4.16 (constraint was >=2017.4.17)
found candidate chardet==3.0.4 (constraint was >=3.0.2,<3.1.0)
found candidate httpie==0.9.9 (constraint was ==0.9.9)
found candidate idna==2.7 (constraint was >=2.5,==2.7,<2.8)
found candidate pygments==2.2.0 (constraint was >=2.1.3)
found candidate requests==2.19.1 (constraint was >=2.11.0,==2.19.1)
found candidate urllib3==1.23 (constraint was >=1.21.1,==1.23,<1.24)
Finding secondary dependencies:
requests==2.19.1 requires certifi>=2017.4.17, chardet<3.1.0,>=3.0.2, idna<2.8,>=2.5, requests==2.19.1; python_version != "3.3.*" and python_version != "3.1.*" and python_version != "3.0.*" and python_version >= "2.6" and python_version != "3.2.*" and python_version < "4", urllib3<1.24,>=1.21.1
httpie==0.9.9 requires certifi>=2017.4.17, chardet<3.1.0,>=3.0.2, httpie==0.9.9; python_version != "3.3.*" and python_version != "3.1.*" and python_version != "3.0.*" and python_version >= "2.6" and python_version != "3.2.*" and python_version < "4", idna<2.8,>=2.5, pygments>=2.1.3, requests>=2.11.0, urllib3<1.24,>=1.21.1
idna==2.7 requires idna==2.7
pygments==2.2.0 requires -
certifi==2018.4.16 requires -
urllib3==1.23 requires urllib3==1.23; python_version != "3.3.*" and python_version != "3.1.*" and python_version != "3.0.*" and python_version >= "2.6" and python_version != "3.2.*" and python_version < "4"
chardet==3.0.4 requires -
------------------------------------------------------------
Result of round 3: stable, done
Locking [packages] dependencies...
Steps to replicate
Provide the steps to replicate (which usually at least includes the commands and the Pipfile). Run pipenv lock on following file:
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"
[packages]
falcon = "*"
docker-compose = "*"
gunicorn = "*"
gensim = "*"
[dev-packages]
httpie = "*"
[requires]
python_version = "3.6"
Please run $ pipenv --support, and paste the results here. Don’t put backticks (`) around it! The output already contains Markdown formatting.
If you’re on macOS, run the following:
$ pipenv --support | pbcopy
If you’re on Windows, run the following:
> pipenv --support | clip
If you’re on Linux, run the following:
$ pipenv --support | xclip
$ pipenv --support
Pipenv version: '2018.7.1'
Pipenv location: '/home/connormclaud/.pyenv/versions/3.6.6/lib/python3.6/site-packages/pipenv'
Python location: '/home/connormclaud/.pyenv/versions/3.6.6/bin/python3.6'
Other Python installations in PATH:
-
2.7:/usr/bin/python2.7 -
2.7:/usr/bin/python2.7 -
3.6:/home/connormclaud/.pyenv/versions/3.6.6/bin/python3.6m -
3.6:/home/connormclaud/.pyenv/versions/3.6.6/bin/python3.6 -
3.6:/home/connormclaud/.pyenv/shims/python3.6 -
3.6:/usr/bin/python3.6 -
3.6.6:/home/connormclaud/.pyenv/versions/3.6.6/bin/python -
3.6.6:/home/connormclaud/.pyenv/shims/python -
2.7.15:/usr/bin/python -
2.7.15:/usr/bin/python2 -
3.6.6:/home/connormclaud/.pyenv/versions/3.6.6/bin/python3 -
3.6.6:/home/connormclaud/.pyenv/shims/python3 -
3.6.5:/usr/bin/python3
PEP 508 Information:
{'implementation_name': 'cpython',
'implementation_version': '3.6.6',
'os_name': 'posix',
'platform_machine': 'x86_64',
'platform_python_implementation': 'CPython',
'platform_release': '4.15.0-29-generic',
'platform_system': 'Linux',
'platform_version': '#31-Ubuntu SMP Tue Jul 17 15:39:52 UTC 2018',
'python_full_version': '3.6.6',
'python_version': '3.6',
'sys_platform': 'linux'}
System environment variables:
CLUTTER_IM_MODULENVM_DIRLS_COLORSLC_MEASUREMENTLESSCLOSELC_PAPERLC_MONETARYXDG_MENU_PREFIXLANGDISPLAYPYENV_ROOTOLDPWDGNOME_SHELL_SESSION_MODECOLORTERMNVM_CD_FLAGSDESKTOP_AUTOSTART_IDUSERNAMEPYENV_HOOK_PATHXDG_VTNRSSH_AUTH_SOCKMANDATORY_PATHS_COLORSLC_NAMEXDG_SESSION_IDUSERPYENV_DIRDESKTOP_SESSIONQT4_IM_MODULETEXTDOMAINDIRGNOME_TERMINAL_SCREENDEFAULTS_PATHPWDHOMETEXTDOMAINSSH_AGENT_PIDPYENV_VERSIONQT_ACCESSIBILITYXDG_SESSION_TYPEXDG_DATA_DIRSXDG_SESSION_DESKTOPLC_ADDRESSLC_NUMERICGTK_MODULESWINDOWPATHVTE_VERSIONSHELLTERMQT_IM_MODULEXMODIFIERSIM_CONFIG_PHASENVM_BINXDG_CURRENT_DESKTOPGPG_AGENT_INFOGNOME_TERMINAL_SERVICESHLVLXDG_SEATPYENV_SHELLLC_TELEPHONEGDMSESSIONGNOME_DESKTOP_SESSION_IDLOGNAMEDBUS_SESSION_BUS_ADDRESSXDG_RUNTIME_DIRXAUTHORITYXDG_CONFIG_DIRSPATHLC_IDENTIFICATIONSESSION_MANAGERLESSOPENGTK_IM_MODULELC_TIMEPYTHONDONTWRITEBYTECODEPIP_PYTHON_PATH
Pipenv–specific environment variables:
Debug–specific environment variables:
PATH:/home/connormclaud/.pyenv/versions/3.6.6/bin:/home/connormclaud/.pyenv/libexec:/home/connormclaud/.pyenv/plugins/python-build/bin:/home/connormclaud/.nvm/versions/node/v10.5.0/bin:/home/connormclaud/.pyenv/shims:/home/connormclaud/.pyenv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/binSHELL:/bin/bashLANG:en_US.UTF-8PWD:/home/connormclaud/PycharmProjects/vectorizer
Contents of Pipfile (‘/home/connormclaud/PycharmProjects/vectorizer/Pipfile’):
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"
[packages]
falcon = "*"
docker-compose = "*"
gunicorn = "*"
gensim = "*"
[dev-packages]
httpie = "*"
[requires]
python_version = "3.6"
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 11
- Comments: 43 (8 by maintainers)
It’s crazy it took almost 20 minutes to create the lock file and there was no sign of activity from the command line. At least you can provide a progress bar with an ETA to notify the user something is going on at background.
Please do not ever run pipenv with sudo, you will now need to
sudo chown -R youruser:yourgroup ~/.cache/pipenvor wherever your cache directory is located. We really can’t provide support if you do this kind of thingDo note that “hangs” is not a descriptive or actionable bug report. You will need to provide actual data, including runtime, network traffic, cpu usage of the process, etc, if you want us to act on your report. If you can’t or won’t provide that information, we can’t help you
I realised this ticket is closed - but as it comes up first in a google search I thought that someone might find it useful to know that, having seen this very issue and struggling to deal with it for a couple of days, I solved it by using
PIP_NO_CACHE_DIR=offwhen runningpipenv installThis should be open. This is still happening with pipenv, version 2020.8.13
Reopening this issue as many users reported experiencing the same.
In my case root cause is bad network (~10% packets are lost). Pipenv install --skip-lock not causes this issue. It is in pipenv lock implementation something is relying on good network connection.
Reproduce
Seems to install fine but locking takes ages and doesn’t seem to finish which makes it impossible to install some things.
I have been noticing this just today as well (hasn’t happened before). When I run either
pipenv lockorpipenv install [PACKAGE], it will get to the locking phase and then simply stop doing anything. Even adding theverboseflag will not display any output other than the singleLocking [packages] dependencies…line.Pipfile
This is my Pipfile after running the command:
Command
I experience the same issue. It gets stuck when locking the dependencies and if I wait long enough i receive timeout error. Im on PyCharm on mac. Im in a Docker app.
I have the same problem in all of my projects. The cause seems to be pylint. Pipenv (pip) can install it successfully, but locking takes forever!
pipenv, version 2018.11.26Minimal working example
I tried to install a tiny package and got stuck forever while consumed ~1GB (!) of traffic in the background.
Is it something wrong with pipenv or I just got so much stale caches in need to be updated? Sorry if I post in the wrong thread.
I am also experiencing this problem with pipenv version
2018.11.26when installing gensim. My Pipfile looks like this:Sir, you have saved my day. Thank you. I don’t know why the issue was closed because the problem is definitely still there. With your fix it looks like it works.
for folks on the november release try setting
export PIPENV_TIMEOUT=900first.Otherwise if you are running this in docker, please provide a dockerfile I can use to reproduce with. We will get to the bottom of this one
Thanks everyone
pipenv is getting stuck at the [locking package dependencies] stage indefinitely.
Similar for me. Pipenv hanging with “Locking…” message about 10 minutes (not hours, but clearly, it can be related). Also, i tried to remove Pip.lock file to fix this behaviour, and got same result.
Here my configuration output (OS - mac os 10.14.1):
$ pipenv --support
Pipenv version:
'2018.11.26'Pipenv location:
'/usr/local/Cellar/pipenv/2018.11.26_1/libexec/lib/python3.7/site-packages/pipenv'Python location:
'/usr/local/Cellar/pipenv/2018.11.26_1/libexec/bin/python3.7'Python installations found:
3.7.2:/Users/xfenix/.virtualenvs/anews-ml-post-recommend-xPg5JB4C/bin/python33.7.2:/usr/local/bin/python33.7.2:/usr/local/bin/python3.7m2.7.10:/usr/bin/python2.7.10:/usr/bin/pythonw2.7.10:/usr/bin/python2.7PEP 508 Information:
System environment variables:
PATHTERM_PROGRAMVIRTUALENVWRAPPER_PROJECT_FILENAMEVIRTUALENVWRAPPER_SCRIPTPIP_PYTHON_PATHSHELLTERMTMPDIRApple_PubSub_Socket_RenderTERM_PROGRAM_VERSIONTERM_SESSION_IDZSHUSERSSH_AUTH_SOCK__CF_USER_TEXT_ENCODINGVIRTUAL_ENVPAGERWORKON_HOMELSCOLORSPIPENV_ACTIVE_VIRTUALENVWRAPPER_HOOK_DIRPWDLANGITERM_PROFILEXPC_FLAGSPYTHONDONTWRITEBYTECODEXPC_SERVICE_NAMEGPG_TTYCOLORFGBGHOMESHLVLMODEL_PATHITERM_SESSION_IDLOGNAMELESSPIP_DISABLE_PIP_VERSION_CHECKLC_CTYPEVIRTUALENVWRAPPER_WORKON_CDSQLITE_EXEMPT_PATH_FROM_VNODE_GUARDSSECURITYSESSIONIDCOLORTERMPIP_SHIMS_BASE_MODULEPYTHONFINDER_IGNORE_UNSUPPORTEDPipenv–specific environment variables:
PIPENV_ACTIVE:1Debug–specific environment variables:
PATH:/usr/local/Cellar/pipenv/2018.11.26_1/libexec/tools:/Users/xfenix/.virtualenvs/anews-ml-post-recommend-xPg5JB4C/bin:/usr/local/Cellar/pipenv/2018.11.26_1/libexec/tools:/Users/xfenix/.nimble/bin:/usr/local/opt/gettext/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Applications/Wireshark.app/Contents/MacOSSHELL:/bin/zshLANG:en_US.UTF-8PWD:/Users/xfenix/web/anews-ml-post-recommendVIRTUAL_ENV:/Users/xfenix/.virtualenvs/anews-ml-post-recommend-xPg5JB4CContents of
Pipfile(‘/Users/xfenix/web/anews-ml-post-recommend/Pipfile’):Contents of
Pipfile.lock(‘/Users/xfenix/web/anews-ml-post-recommend/Pipfile.lock’):I was having the same issue on pipenv 2018.5.18 (it was hanging at
Locking [packages] dependencies...when trying to runpipenv install ansible), but upgrading to 2018.7.1 seemed to help. It still took a while, but it didn’t get stuck for ages.Hadn’t realized I was running an older version since I haven’t developed anything on this machine in a couple months.
I narrowed down this issue to single package
behaves the same. Pipenv lock just hangs