I tried switching from venv
& conda
to pipenv
to manage my virtual environments, but one thing I noticed about pipenv
that it's oddly slow when it's doing "Locking" and it gets to the point where it stops executing for "Running out of time". Is it usually this slow or is it just me? Also, could you give me some advice regarding how to make it faster?
5 Answers
Yes, I've found pipenv's locking and dependency resolution is terrible. For what it's worth, I've moved to just venv
and poetry. The poetry github has a section talking about pipenv, and also note that poetry is a little less concerned with your actual virtual environment, and more about dependency management/packaging.
-
Poetry looks very promising and well documented, I'll give it a try. Thanks for the recommendation :)– MoSalahCommented Aug 25, 2019 at 13:51
-
are you happy with poetry? I found it very focused on 'installable' packages– RoelantCommented Sep 23, 2020 at 12:49
-
2We have done some performance enhancements to
pipenv
in recent times, including a big install optimization which released2022.8.31
. For an independent comparison of benchmarks, please have a look at: lincolnloop.github.io/python-package-manager-shootout– MatteiusCommented Sep 1, 2022 at 10:42 -
Poetry's README.md no longer has a section about Pipenv (since github.com/python-poetry/poetry/pull/5561 was merged). The removal was because "poetry is big enough and mature enough to stand on its own merits".– Eli_BCommented Sep 7, 2023 at 15:22
Pipenv is literally a joke. I spent 30 minutes staring at "Locking", which eventually fails after exactly 15 minutes, and I tried two times. The most meaningless thirty minutes in my life.
Was my Pipfile complex? No. I included "flask" with "flake8" + "pylint" + "mypy" + "black".
Every time someone tries to fix the "dependency management" of Python, it just gets worse. I'm expecting Poetry to solve this, but who knows.
Maybe it's time to move on to typed languages for web development.
-
2The latest version of pipenv which is currently
2022.8.31
and has a number of optimizations and bug fixes since your comment over 2 years ago.– MatteiusCommented Sep 1, 2022 at 10:47 -
5Downvoted: this is a rant, not an answer; also "Pipenv is literally a joke": no, it's not, it's figuratively a joke.– AkiRossCommented May 29, 2023 at 8:44
-
2@AkiRoss No offense, but it is still an answer to the OP's "Is it usually this slow or is it just me?", and I answered, "It's not just you, I wasted many minutes using it!" :)– Jay LeeCommented May 29, 2023 at 9:20
-
2No offense taken. I don't think that "it's not only you" is a valid answer to a problem and a comment would have been enough for that ;) The rant, while I get and share the frustration, it's not useful to solve the problem.– AkiRossCommented May 29, 2023 at 11:47
-
1@Matteius any way to update the "Locking..." message to something less anger inducing :) I just stopped the install multiple times because I didn't understand what "Locking" meant. I think it actually means "Downloading...25% Complete on such-and-such a package" and then later "Locking...". This was a vastly different experience coming from npm, maven, etc and so was very confusing.– CaseyCommented Jul 2, 2023 at 2:31
Long-time ago, it was slow for reason. But now, it is slow for no reason:
https://github.com/pypa/pipenv/issues/3827
Please see this issue, there are a lot of similar issues about that ridiculous locking performance. But as you see, they call it "Enhancement". Well, forgive me, WTF, it is literally a bug.
-
-
Myself and another developer took on the maintenance of pipenv at the start of this year and have been making a number of improvements. For an independent comparison of latest benchmarks, please have a look at: lincolnloop.github.io/python-package-manager-shootout– MatteiusCommented Sep 1, 2022 at 10:50
try using --skip-lock
like this :
pipenv install --skip-lock
Note : do not skip-lock when going in production
I have observed faster turn-around times with the following flow.
pipenv --rm && rm -rf Pipfile.lock && pipenv install --dev .
pipenv
does a poor job of logging what exactly it is doing during the seemingly interminable "Locking..." phase.