Closed Diggsey closed 7 years ago
Hey again @Diggsey, this is due to the way we're writing changes right now. I have these changes ready to merge but they're breaking for the projects.py
API so we're going to hold off until the next major release. Hopefully we'll have this up and ready in the next few weeks. I'll leave this open to track the issue for now.
We sprinted on this together at PyCon. It'll be faster soon.
Right now for me it is not slow, it is freezing...
A pipenv install my_package
or a simple pipenv install
does not give me any output, after 20 minutes.
EDIT: Confirmation, still nothing after a few hours. Is it the same problem? Usually it was slow, but it ended after 5 to 10 minutes.
Hey @NicolasWebDev, what version of pipenv are you using? Also do you have delegator.py
installed on your system separately? If so, what version is that at? This was an issue that should have been resolved in v3.6.0.
If everything above is up to date, could you please provide the contents of your Pipfile? Thanks!
Hi @nateprewitt, you were right, I was on v3.5.x. Updating to 4.1.1 resolved the freezing issue. Now it is still taking 5 minutes, but at least it is usable!
Sorry for the noise, I always forget that packages installed through pip are not automatically updated. Thanks!
Glad you got things resolve @NicolasWebDev! We're working on getting this sped up more, hopefully #373 will be a step closer in the next release.
@Diggsey @NicolasWebDev, I've just released 4.1.2 which should have these speed improvements added. There's still some work to do here, but this will at least expedite the initial bootstrap time for pipenv.
@nateprewitt Thanks for the update, pipenv does seem faster for me now, but it still takes several minutes just to run pipenv lock
, even when nothing has changed - it still waits in Locking [packages] dependencies...
for the vast majority of that time.
@Diggsey, a lot of that time is because you're downloading a huge number of files in that Pipfile. It seems like you're pinning all of your dependencies too. Are you directly importing all of these into your project or are some dependency requirements of the others?
@nateprewitt We could remove some of them, but the majority are direct dependencies - why does it need to download all of the dependencies every time it generates the lock file?
We need to determine everything that it installs as dependencies. In order to get that, we download each package and determine what an installation looks like at lock time. This allows us to appropriately pin everything in the Pipfile.lock. Without downloading, there isn't a reliable way of checking sub-dependencies and resolving range dependency declarations.
Given that most of the packages are going to stay the same over time, would it be possible to cache the downloaded packages?
@Diggsey want to look into that for us?
This might be a silly question, but doesn’t Pip already do package caching?
I'm under the impression that it does.
Can pipenv use the pip cache system or it has to be implemented from the scratch?
Pipenv just runs pip, so the cache should automatically be used.
fixed! lock is wicked fast now.
Oh, thank you. I think that was the only thing holding my back from pushing everyone over to pipenv at work.
Wow, nice, that was literally more than a 100x speedup for me, and it also caught a dependency conflict that the previous version didn't catch!
What would be useful is a verbose
flag for pipenv lock
- I was only able to diagnose the dependency conflict by editing piptools/logging.py
to enable verbose logging, but once I did that it gave a very clear indication of what was going on.
I'm probably missing something :) Where is it fixed? Latest release is 4 days ago, so I installed latest version from master
. However, pipenv install
is still slow.
I tried:
pipenv
the fancy way ⚡️ 🍰 ⚡️ pipenv
and latest version from master
Using latest stable version (5.3.5.), it takes 3:40 to install one package:
∙ time pipenv install --dev raven
Installing raven...
Collecting raven
Using cached raven-6.1.0-py2.py3-none-any.whl
Collecting contextlib2 (from raven)
Using cached contextlib2-0.5.5-py2.py3-none-any.whl
Installing collected packages: contextlib2, raven
Successfully installed contextlib2-0.5.5 raven-6.1.0
Adding raven to Pipfile's [dev-packages]...
Locking [dev-packages] dependencies...
Locking [packages] dependencies...
Updated Pipfile.lock!
pipenv install --dev raven 10,11s user 2,77s system 5% cpu 3:40,04 total
Using version from master
, it still hangs (one package, +10 minutes)
EDIT: It has just finished:
pipenv install graphene_django 8,03s user 1,28s system 1% cpu 11:23,11 total
Any ideas? Thanks a lot!
Sometimes dependencies take a while to install, especially if they have c compilations. Want to share your Pipfile
?
I understand sometimes it takes a while, but it was slow from the beginning. Just curious if it's a problem at my side.
Here's my Pipfile:
[[source]]
url = "https://pypi.python.org/simple"
verify_ssl = true
[dev-packages]
pytest = "*"
pytest-django = "*"
pytest-testmon = "*"
pytest-watch = "*"
django-debug-toolbar = "*"
raven = "*"
[packages]
dj-database-url = "*"
Django = "*"
djangorestframework = "*"
gunicorn = "*"
newrelic = "*"
psycopg2 = "*"
requests = "*"
whitenoise = "*"
graphene-django = "*"
psycopg2 might be taking a while, as it may be compiling from source. Everything else should be nice and fast. Try removing it and see how much your speed increases.
$ pipenv install raven
just took like 1s for me.
$ pipenv install raven just took like 1s for me.
That's what I would expect! Can I turn on verbose output somehow?
I tried remove psycopg2
, but it doesn't affect much. Running pipenv install raven
hangs for a while.
I have:
i see no reason why raven shouldn't be instantaneous.
do $ pip install raven
inside of $ pipenv shell
and tell me if it's slow there too.
All pipenv is doing is running pip, so that's effectively the "verbose mode"
That's instant:
∙ time pip install raven 19:38 tricoder@issac
Requirement already satisfied: raven in /Users/tricoder/.envs/lingui-api-VE1OToiy/lib/python3.6/site-packages
Requirement already satisfied: contextlib2 in /Users/tricoder/.envs/lingui-api-VE1OToiy/lib/python3.6/site-packages (from raven)
noglob pip install raven 0,54s user 0,15s system 76% cpu 0,900 total
Running pipenv
hangs about 2-3 minutes (inside/outside pipenv shell
).
∙ time pipenv install raven 19:39 tricoder@issac
Installing raven...
Requirement already satisfied: raven in /Users/tricoder/.envs/lingui-api-VE1OToiy/lib/python3.6/site-packages
Requirement already satisfied: contextlib2 in /Users/tricoder/.envs/lingui-api-VE1OToiy/lib/python3.6/site-packages (from raven)
Adding raven to Pipfile's [packages]...
Locking [dev-packages] dependencies...
Locking [packages] dependencies...
Updated Pipfile.lock!
pipenv install raven 4,49s user 0,46s system 2% cpu 3:21,17 total
@Diggsey can you open a new issue about --verbose
and provide an example of what you'd like it to look like?
@tricoder42 is the slow part the locking step or the install step? Locking was vastly improved in the latest releases.
$ time pipenv install raven
Installing raven...
Collecting raven
Using cached raven-6.1.0-py2.py3-none-any.whl
Requirement already satisfied: contextlib2 in /Users/kennethreitz/.local/share/virtualenvs/pipenv-u9yqWeFK/lib/python3.6/site-packages (from raven)
Installing collected packages: raven
Successfully installed raven-6.1.0
Adding raven to Pipfile's [packages]...
Locking [dev-packages] dependencies...
Locking [packages] dependencies...
Updated Pipfile.lock!
9.30 real 5.49 user 0.42 sys
It's like 50:50 installing:locking
@tricoder42 and you're using latest?
Let me replicate with your exact pipfile.
I guess so:
∙ pipenv --version 19:42 tricoder@issac
pipenv, version 5.3.5
∙ pipsi upgrade git+https://github.com/kennethreitz/pipenv.git#egg=pipenv 19:45 tricoder@issac
Collecting pipenv from git+https://github.com/kennethreitz/pipenv.git#egg=pipenv
Cloning https://github.com/kennethreitz/pipenv.git to /private/var/folders/g9/1wbckv154mbby3tm411z_m340000gn/T/pip-build-se4ao5/pipenv
...
Installing collected packages: pipenv
Found existing installation: pipenv 5.3.5
Uninstalling pipenv-5.3.5:
Successfully uninstalled pipenv-5.3.5
Running setup.py install for pipenv ... done
Successfully installed pipenv-5.3.5
$ time pipenv install
No package provided, installing all dependencies.
Pipfile found at /Users/kennethreitz/pipenv/testapp/Pipfile. Considering this to be the project home.
Pipfile.lock not found, creating...
Locking [dev-packages] dependencies...
Locking [packages] dependencies...
Updated Pipfile.lock!
Installing dependencies from Pipfile.lock...
[================================] 22/22 - 00:00:37
58.94 real 40.51 user 8.62 sys
It does even when I'm installing first package into fresh new pipenv. I'll try to create pipenv --three
instead of pipenv --python python3.6
@tricoder42 want to hop on a google hangouts in like an hour?
Or we can use Apple screen sharing if you use Messages.app.
Add me! I'm me@kennethreitz.org.
I'm about to join a meeting, but I'll be available after that.
Cool! I'll try clean & reinstall everything from the scratch and we'll see. I'm available in one hour
Awesome — we'll figure this out then. Add me on messages.app :)
If anyone is experiencing extremely slow Locking
behavior with v11.9.0
, i found that downgrading to v9.0.0
takes a 5m30s install down to 1m36s.
@ryantuck I'd recommend if you're going to pin an old version to pin 9.0.3
but you lose a significant amount of added security for the speed, you might as well just use --skip-lock
at that point
--skip-lock
definitely sped things up. I went down this path because pipenv install --system --python=3.6
wasn't actually installing to the correct system python, and i was under the assumption that i needed to generate the Pipfile.lock
before attempting the system install. It still didn't work, so I went back to using regular old pip
, but will comment back on this thread if I ever make any progress along these lines.
—system
and —python
are mutually exclusive — the latter option always needs a virtualenv
yep, locking takes a while for me too. v11.10.0. Ubuntu on WSL.
[[source]]
url = "https://pypi.python.org/simple"
verify_ssl = true
name = "pypi"
[packages]
babel = "==2.5.3"
"boto3" = "==1.7.3"
colorama = "==0.3.9"
coreapi = "==2.3.3"
dj-database-url = "==0.5.0"
djangorestframework = "==3.7.7"
django-axes = "==4.0.2"
django-clever-selects = "==0.8.2"
django-crispy-forms = "==1.7.2"
django-choices = "==1.6.0"
django-extra-views = "==0.10.0"
django-filter = "==1.1.0"
django-hijack = "==2.1.7"
django-hijack-admin = "==2.1.7"
django-js-reverse = "==0.8.1"
django-model-utils = "==3.1.1"
django-phonenumber-field = "==2.0.0"
django-polymorphic = "==2.0.2"
django-redis-cache = "==1.7.1"
django-role-permissions = "==2.2.0"
"django-s3direct" = "==1.0.4"
django-static-precompiler = {extras = ["libsass"], version = "==1.8.2"}
django-storages = "==1.6.6"
"django-tables2" = "==1.21.2"
django-webpack-loader = "==0.6.0"
django-widget-tweaks = "==1.4.2"
facebookads = "==2.11.4"
googleads = "==11.0.1"
markdown = "==2.6.11"
phonenumbers = "==8.9.3"
pillow = "==5.1.0"
"psycopg2-binary" = "==2.7.4"
pygments = "==2.2.0"
pyssim = "==0.4"
python-dotenv = "==0.8.2"
pytz = "==2018.4"
raven = "==6.6.0"
sendgrid-django = "==4.2.0"
slacker = "==0.9.65"
termcolor = "==1.1.0"
tqdm = "==4.21.0"
twitter-ads = "==3.0.0"
brotlipy = "==0.7.0"
waitress = "==1.1.0"
whitenoise = "==3.3.1"
Django = "==2.0.4"
[dev-packages]
coverage = "==4.5.1"
selenium = "==3.11.0"
tblib = "==1.3.2"
"flake8" = "==3.5.0"
django-debug-toolbar = "==1.9.1"
django-extensions = "==2.0.6"
[requires]
python_version = "3.6"
Pipfile.lock not found, creating…
Locking [dev-packages] dependencies…
Locking [packages] dependencies…
Updated Pipfile.lock (7a535c)!
Installing dependencies from Pipfile.lock (7a535c)…
🐍 ▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉ 92/92 — 00:01:01
real 8m1.993s
user 5m32.406s
sys 7m15.203s
It should be a little bit faster the second or third time because of caching tho. Do you see an improvement? On Thu, Apr 12, 2018 at 10:23 AM Alexander Kavanaugh < notifications@github.com> wrote:
yep, locking takes a while for me too. v11.10.0. Ubuntu on WSL.
[[source]]url = "https://pypi.python.org/simple"verify_ssl = truename = "pypi" [packages]babel = "==2.5.3""boto3" = "==1.7.3"colorama = "==0.3.9"coreapi = "==2.3.3"dj-database-url = "==0.5.0"djangorestframework = "==3.7.7"django-axes = "==4.0.2"django-clever-selects = "==0.8.2"django-crispy-forms = "==1.7.2"django-choices = "==1.6.0"django-extra-views = "==0.10.0"django-filter = "==1.1.0"django-hijack = "==2.1.7"django-hijack-admin = "==2.1.7"django-js-reverse = "==0.8.1"django-model-utils = "==3.1.1"django-phonenumber-field = "==2.0.0"django-polymorphic = "==2.0.2"django-redis-cache = "==1.7.1"django-role-permissions = "==2.2.0""django-s3direct" = "==1.0.4"django-static-precompiler = {extras = ["libsass"], version = "==1.8.2"}django-storages = "==1.6.6""django-tables2" = "==1.21.2"django-webpack-loader = "==0.6.0"django-widget-tweaks = "==1.4.2"facebookads = "==2.11.4"googleads = "==11.0.1"markdown = "==2.6.11"phonenumbers = "==8.9.3"pillow = "==5.1.0""psycopg2-binary" = "==2.7.4"pygments = "==2.2.0"pyssim = "==0.4"python-dotenv = "==0.8.2"pytz = "==2018.4"raven = "==6.6.0"sendgrid-django = "==4.2.0"slacker = "==0.9.65"termcolor = "==1.1.0"tqdm = "==4.21.0"twitter-ads = "==3.0.0"brotlipy = "==0.7.0"waitress = "==1.1.0"whitenoise = "==3.3.1"Django = "==2.0.4" [dev-packages]coverage = "==4.5.1"selenium = "==3.11.0"tblib = "==1.3.2""flake8" = "==3.5.0"django-debug-toolbar = "==1.9.1"django-extensions = "==2.0.6" [requires]python_version = "3.6"
Pipfile.lock not found, creating… Locking [dev-packages] dependencies… Locking [packages] dependencies… Updated Pipfile.lock (7a535c)! Installing dependencies from Pipfile.lock (7a535c)… 🐍 ▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉ 92/92 — 00:01:01
real 8m1.993s user 5m32.406s sys 7m15.203s
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/pypa/pipenv/issues/356#issuecomment-380882203, or mute the thread https://github.com/notifications/unsubscribe-auth/ABhjqwIPyHtX0NTVoV1UPYR7HcwYm-2kks5tn42SgaJpZM4NbeoN .
I had already installed the packages before that; I just removed the lockfile and ran install again. I'll do it again to get another data point
Running
pipenv install
after changing one dependency takes about ~5 minutes for me, on a windows 10 machine with an SSD.The vast majority of that time is spent inside
Locking [packages] dependencies...
It seems like there might be some quadratic-or-worse complexity in this step?
I've included most of our pipfile below, but I had to remove some of our private repo dependencies: