Skip to content
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

pip hangs even at simple commands #3360

Closed
beruic opened this issue Jan 14, 2016 · 8 comments
Closed

pip hangs even at simple commands #3360

beruic opened this issue Jan 14, 2016 · 8 comments
Labels
auto-locked Outdated issues that have been locked by automation

Comments

@beruic
Copy link

beruic commented Jan 14, 2016

After finding my old Raspberry Pi and starting to play with it, it has become apparent to me that pip hangs initially on every command. Even a simple pip -h takes 7 seconds on my Raspberry Pi.

I checked this on my regular computer, and noticed a small delay on that one too. something that works purely locally, like pip -h or pip freeze, should be blazing fast.

@dstufft
Copy link
Member

dstufft commented Jan 19, 2016

Does this happen if you pass --disable-pip-version-check as an option?

@beruic
Copy link
Author

beruic commented Apr 2, 2016

I finally got to try it out. Still takes 7 seconds to do a pip freeze with or without the option.

@xavfernandez
Copy link
Member

From what I rememeber when I had looked at it, one major source of slowness came from the import of pkg_resources (which happens whatever you are doing in pip), because it checks all the paths for installed python modules.

From a small sample of calls:

  • fastest time pip took 311 ms on my machine.
  • fastest time python -c "import pkg_resources" took 165 ms

We could maybe try to only import pkg_resources when necessary but I don't feel this is a major issue.

@beruic
Copy link
Author

beruic commented Apr 6, 2016

I agree this is not major. Just annoying when you work with slow hardware, like the Raspberry Pi :)
However it seems to be only really bad on older Pis with a single core.

@tiagoboldt
Copy link

Lack of performance on the Raspberry Pi doesn't seem to be a pip issue, but a python's one. Most python applications that load multiple libraries take a huge time to start. I don't believe there will be something to do on pip's side.

@dstufft
Copy link
Member

dstufft commented Mar 30, 2017

Closing this, this seems to be an issue related to the performance of the Raspberry Pi and there's not much pip can do about it.

@DMW007
Copy link

DMW007 commented Oct 21, 2017

I'd fallen into this issue since I started using docker-compose with pip, as recommended in the Docker docs. Even simple commands like --version take seconds to complete:

pi@pi3:~ $ time docker-compose --version
docker-compose version 1.16.1, build 6d1ac219

real    0m6,700s
user    0m6,380s
sys     0m0,260s

It seems caused by pip, since both pip2 and pip3 are compareable slow:

pi@pi3:~ $ time pip2 --version
pip 9.0.1 from /usr/lib/python2.7/dist-packages (python 2.7)

real    0m5,446s
user    0m5,260s
sys     0m0,130s

pi@pi3:~ $ time pip3 --version
pip 9.0.1 from /usr/lib/python3/dist-packages (python 3.5)

real    0m8,436s
user    0m8,230s
sys     0m0,150s

I couldn't belive that this is caused by the hardware of the Raspberry Pi. I tested this on both Raspberry 2 and 3, both are slow on docker-compose/pip. Altough the Pi3 is faster than the 2. Only Pip seems affected, cause other tools like docker itself are pretty fast:

pi@pi3:~ $ time docker --version
Docker version 17.09.0-ce, build afdb6d4

real    0m0,109s
user    0m0,060s
sys     0m0,040s

@pradyunsg
Copy link
Member

@DMWOO7 That is indeed something we're looking into improving in the future -- there's #4768 for that.

@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Jun 2, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jun 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
auto-locked Outdated issues that have been locked by automation
Projects
None yet
Development

No branches or pull requests

6 participants