27

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?

1
  • 4
    At the very least, pipenv does a poor job of logging what exactly it is doing during the seemingly interminable "Locking..." phase.
    – chepner
    Commented Aug 25, 2019 at 13:19

5 Answers 5

26

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.

4
  • Poetry looks very promising and well documented, I'll give it a try. Thanks for the recommendation :)
    – MoSalah
    Commented Aug 25, 2019 at 13:51
  • are you happy with poetry? I found it very focused on 'installable' packages
    – Roelant
    Commented Sep 23, 2020 at 12:49
  • 2
    We have done some performance enhancements to pipenv in recent times, including a big install optimization which released 2022.8.31. For an independent comparison of benchmarks, please have a look at: lincolnloop.github.io/python-package-manager-shootout
    – Matteius
    Commented 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_B
    Commented Sep 7, 2023 at 15:22
17

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.

5
  • 2
    The 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.
    – Matteius
    Commented Sep 1, 2022 at 10:47
  • 5
    Downvoted: this is a rant, not an answer; also "Pipenv is literally a joke": no, it's not, it's figuratively a joke.
    – AkiRoss
    Commented 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 Lee
    Commented May 29, 2023 at 9:20
  • 2
    No 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.
    – AkiRoss
    Commented 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.
    – Casey
    Commented Jul 2, 2023 at 2:31
6

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.

2
  • Yeah, there's a lot of issues, it's performing very poorly! I don't know why people kept recommending it for me. However, I think I'll give poetry a shot and see how it's doing.
    – MoSalah
    Commented Aug 25, 2019 at 13:56
  • 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
    – Matteius
    Commented Sep 1, 2022 at 10:50
4

try using --skip-lock like this :

pipenv install --skip-lock

Note : do not skip-lock when going in production

1

I have observed faster turn-around times with the following flow.

pipenv --rm  && rm -rf Pipfile.lock && pipenv install --dev .

Not the answer you're looking for? Browse other questions tagged or ask your own question.