-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pipenv lock still takes way too long to complete #4430
Comments
Thanks for raising this @mjpieters, thought I was going crazy. Downgrading to |
Yes, +1! Thanks for looking into this, Martijn! We had exactly the same issue (lots of big tmp directories), but sorta gave up for the time being… I couldn't really argue much when (and hi, btw 👋) |
A "workaround" that may work (and what we have used from time to time) is to remove the lock file and rerun the lock. This may also hint at the underlying problem, which may have something to do with how pipenv is using the existing lock file during the lock process. |
Deleting the |
Can you have a try on the master branch? I recently disabled the copying of the local source tree. |
Do you mean #4421? That's been part of the 2020.8.13 release that I tested with for this issue. I did note that the tree copying no longer takes place. I also don't see any changes on master since 2020.8.13 was released that look relevant. Did I miss something? |
If I remember correctly, 2018.11.26 didn't resolve transient dependencies of an editable package. You can compare the lock files generated by both versions. |
I see no differences that look problematic. With With the lock file deleted and using |
I removed all other dependencies except the editable one. It turns out no significant difference is seen in the time costs of 2018.11.26 and 2020.8.13. It will be great if you can narrow down which package brings the performance degrading. I created a demo repo to showcase the issue, which you can clone and adjust to reproduce the performance issue: $ docker build . --build-arg PIPENV_VER=2020.8.13 -t pipenv-bug
$ docker build . --build-arg PIPENV_VER=2018.11.26 -t pipenv-bug |
Sorry, I meant to get back to this but current project work is keeping me over-utilised. I do still find Pipenv to be excruciatingly slow, and regularly have to delete the lock file just to get a solution, but that's not really very actionable feedback. |
I'm having this problem in February 2021. Even deleting lock file, it is still very slow. |
Same here, deleting lock file doesn't help |
same here, there are any news? |
same here |
Version 2020.11.15, does not take half an hour for me, but couple of minutes is too much for creating 40 KiB JSON file. |
Why pipenv why so slow? Why? |
This issue is still present in April of 2021. I have yet to look into why this is, but I know it doesn't have to be this way because there are other managers that work better and faster. For instance, I recommend using Poetry until this is fixed. |
I did not investigate the code, but I think it happens because on every run |
On 22 April 2021 02:53:29 CEST, Tyler J Russell ***@***.***> wrote:
This issue is still present in April of 2021. I have yet to look into
why this is, but I know it doesn't *have* to be this way because there
are other managers that work better and faster.
For instance, I recommend using Poetry until this is fixed.
Or have a look at pdm. You can make it use venvs instead of __pypackages__, if you want. And it can import your Pipfile.
|
Or have a look at pdm. You can make it use venvs instead of
__pypackages__, if you want. And it can import your Pipfile.
Interesting. I'll take a look later. I like Poetry, though, because it
addresses another issue I noticed with pipenv - it uses a standard from
PEP 518 that's likely to work with other toolchains (`pyproject.toml` as
opposed to `Pipfile`).
|
just move to poetry - faster locks overall better performance |
That's not really constructive at all. It's better to work on helping people here. I only suggested it as a temporary solution so people don't have to deal with the hassle while they wait for a fix. You wouldn't walk into Google's headquarters and tell everyone to "just use DuckDuckGo", would you? It's basic respect. |
I'll be running tests later. I think the best way to resolve this is to time each stage of the lock and see which ones take the longest so we can determine where the problem comes from and attempt to fix it. |
pipenv spawns a number of subprocesses during the lock, does this take any of that into account? ** edit ** I have found this is also why a lot of the output is hidden during verbose running; the stdout/stderr of the worker processes are not propagated up. |
pipenv spawns a number of subprocesses during the lock, does this take
any of that into account?
It'll time exactly as long as each step takes to complete. Does it run
the `do_lock` in worker threads, or spawn the worker threads from
`do_lock`? I couldn't tell when I looked.
|
I've found the way to profile |
I've found the way to profile `pipenv install`
Marvellous. Thank you.
I'll investigate later - although, at a glance, the presence of
time.sleep is interesting.
|
I'm pretty sure that those are inside |
Yup, it's the vendored pexpect wait loop. pipenv/pipenv/vendor/pexpect/expect.py Lines 153 to 184 in 275f7e1
and pipenv/pipenv/vendor/pexpect/spawnbase.py Lines 72 to 77 in 275f7e1
Note that there's no point in setting it to |
Help me understand - is this acknowledged and are there plans to address this? |
I have implemented Pipenv with my team recently, but the time it take to install even one package is crazy, I tried with panda, it took between 5mn to 8mn. 41 packages takes around 20mn to install. I have tried the following :
Nothing work so far |
Same problem for me; locking is so slow that we are currently within the very dangerous situation of avoiding to update the lockfile whenever possible to avoid losing hours of waiting times |
- Pipfile has some known issue with locking file pypa/pipenv#4430 - Setup.py is what cdk init generates and we wanted to avoid some instruction confusion Co-authored-by: Jang <[email protected]>
To all the people thinking that Poetry is the answer and is perfectly fast in all cases: You are wrong. Both Pipenv and Poetry are having these issues partly due to the nature how dependency management works / does not work in Python. |
Totally agree, with lot's of dependencies it's slow too. |
anecdotally, switching my medium sized project to poetry solved all of my performance issues. |
Same, this simply feels wrong but often locking just takes ages… |
I'm also trying to use |
For some reason locking pandas takes soooo long in my project. I even activated verbose mode, but still it does not give me any information what it is doing for 10min now... (found another "closed" issue: #1198)
Is there a way how to solve this with pipenv? |
@tbrodbeck What version are you on? Can you try the branch linked off this issue? #4926 |
@tbrodbeck I thinks it's bad taste to advocate another project here. So try the different branch. But there are alternatives to poetry, like pdm. |
@matteius I am on version 2022.1.8 and Python 3.9.2 I tried to switch to the last branch mentioned, but I cannot access it:
|
@tbrodbeck I am sorry for I should have been more clear that its this passing branch with the pip 22.0.4 vendoring changes: #4969 |
I think you would need to provide me some installation instructions. I was not able to install the branch with |
@tbrodbeck Hmmm, I seem to recall having issues with the install command as well, so I have been installing it using |
Hmm I am still getting permission denied:
|
@tbrodbeck I'd rather not ping all these people with each update -- perhaps make a new issue report and we can discuss more. I suspect you need to |
Pipenv unfortunately it is terribly slow in my case. Locking is taking more than 30min and still has not completed.
I'm using pipenv, version 2022.4.8. Any suggestion how to solve this issue would be much appreciated. |
I have more than 120 packages and it took about 1 hour, i thought the problem in me, but i was wrong, it's awfull use it in this state |
@leirons Are you locking against pypi or a private package server? Private servers do not provide a hash API that is used to optimize the lock generation process. |
@em1208 I just tried your example from within my Ubuntu VirtualBox VM (which is slower than my native machine) and it took 4.5 minutes.
|
I am locking this discussion of this old and closed issue, and I am once again asking that if you are having a new issue that you don't respond to an old closed issue report with minimal details -- please open a new issue report and follow the template. It is highly likely that your comment could be missed responding to an old issue as well, because we actively prioritize and tag new issues as they come in. |
pipenv lock
is still taking up to 30 minutes to complete for my medium-sized project.While #4403 was closed as fixed and indeed no full tree copies are made any more,
pipenv lock
is still unworkably slow. What used to take 50 seconds under2018.11.26
, now takes 30 minutes to figure out that nothing changed:This is making it untenable to keep using Pipenv.
Full
pipenv lock -v
output in a gist.Pipfile:
where
project-name
(redacted name) lists the followinginstall-requires
lines:install_requires = apache-airflow[aws,celery,postgres,redis] >= 1.10.11 airflow_multi_dagrun airflow-prometheus-exporter
$ pipenv --support
Pipenv version:
'2020.8.13'
Pipenv location:
'/usr/local/Cellar/pipenv/2020.8.13/libexec/lib/python3.8/site-packages/pipenv'
Python location:
'/usr/local/Cellar/pipenv/2020.8.13/libexec/bin/python3.8'
Python installations found:
3.9.0
:/Users/mj/bin/python3.9
3.8.5
:/usr/local/bin/python3
3.8.5
:/usr/local/bin/python3.8
3.8.3
:/Users/mj/bin/python3.8
3.7.7
:/Users/mj/bin/python3.7
3.7.6
:/opt/miniconda3/bin/python3
3.7.6
:/opt/miniconda3/bin/python3.7m
3.7.6
:/opt/miniconda3/bin/python3.7
3.7.3
:/Users/mj/.pyenv/versions/3.7.3/bin/python3
3.6.10
:/Users/mj/bin/python3.6
3.6.1
:/Users/mj/bin/pypy3
3.5.9
:/Users/mj/bin/python3.5
3.4.10
:/Users/mj/bin/python3.4
3.3.7
:/Users/mj/bin/python3.3
3.2.6
:/Users/mj/bin/python3.2
2.7.18
:/Users/mj/bin/python2.7
2.7.16
:/usr/bin/python2.7
2.6.9
:/Users/mj/bin/python2.6
2.5.6
:/Users/mj/bin/python2.5
2.4.6
:/Users/mj/bin/python2.4
PEP 508 Information:
System environment variables:
PATH
AUTOJUMP_ERROR_PATH
NVM_INC
TERM_PROGRAM
GIT_PROMPT_END
rvm_bin_path
AUTOJUMP_SOURCED
GEM_HOME
NVM_CD_FLAGS
SHELL
TERM
HISTSIZE
TMPDIR
COPYFILE_DISABLE
IRBRC
Apple_PubSub_Socket_Render
CONDA_SHLVL
PERL5LIB
TERM_PROGRAM_VERSION
CONDA_PROMPT_MODIFIER
TERM_SESSION_ID
MY_RUBY_HOME
PERL_MB_OPT
LC_ALL
USER
HISTFILESIZE
NVM_DIR
COMMAND_MODE
CONDA_EXE
rvm_path
SSH_AUTH_SOCK
__CF_USER_TEXT_ENCODING
PTPIMG_API_KEY
_CE_CONDA
rvm_prefix
_
CONDA_PREFIX
PWD
HOMEBREW_GITHUB_API_TOKEN
EDITOR
LANG
ITERM_PROFILE
PYTHONSTARTUP
XPC_FLAGS
ITERM_ORIG_PS1
XPC_SERVICE_NAME
HISTCONTROL
_CE_M
FIGNORE
rvm_version
COLORFGBG
HOME
SHLVL
LC_TERMINAL_VERSION
ITERM_PREV_PS1
ITERM_SESSION_ID
PERL_LOCAL_LIB_ROOT
LOGNAME
CONDA_PYTHON_EXE
LC_CTYPE
GEM_PATH
GIT_PROMPT_ONLY_IN_REPO
CONDA_DEFAULT_ENV
NVM_BIN
DISPLAY
LC_TERMINAL
HGSRC
SECURITYSESSIONID
RUBY_VERSION
PERL_MM_OPT
COLORTERM
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/Cellar/pipenv/2020.8.13/libexec/tools:/usr/local/google-sdks/google-cloud-sdk/bin:/Users/mj/perl5/bin:/Users/mj/.nvm/versions/node/v12.14.1/bin:/Users/mj/.rvm/gems/ruby-2.3.0/bin:/Users/mj/.rvm/gems/ruby-2.3.0@global/bin:/Users/mj/.rvm/rubies/ruby-2.3.0/bin:/opt/miniconda3/bin:/opt/miniconda3/condabin:/Users/mj/bin:/Users/mj/Development/Library/zopatista_setup/bin:/Users/mj/Development/Library/zopatista_setup/audio:/usr/local/Cellar/ruby/2.7.1_2/bin:/Users/mj/.cargo/bin:/Users/mj/.poetry/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/usr/local/MacGPG2/bin:/usr/local/sbin:/opt/X11/bin:/Applications/Postgres.app/Contents/Versions/latest/bin:/Users/mj/.local/bin:/Users/mj/.rvm/bin:/Applications/Visual Studio Code.app/Contents/Resources/app/bin
SHELL
:/bin/bash
EDITOR
:vim
LANG
:en_GB.UTF-8
PWD
:/Users/mj
The text was updated successfully, but these errors were encountered: