Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sometimes pip install is very slow

Tags:

python

pip

I am sure it is not network issue. Some of my machine install packages using pip is very fast while some other machine is pretty slow, from the logs, I suspect the slow is due to it will compile the package, I am wondering how can I avoid this compilation to make the pip installation fast. Here's the logs from the slow pip installation.

Collecting numpy==1.10.4 (from -r requirements.txt (line 1))   Downloading numpy-1.10.4.tar.gz (4.1MB)     100% |████████████████████████████████| 4.1MB 95kB/s Requirement already satisfied (use --upgrade to upgrade): wheel==0.26.0 in ./lib/python2.7/site-packages (from -r requirements.txt (line 2)) Building wheels for collected packages: numpy   Running setup.py bdist_wheel for numpy ... - done   Stored in directory: /root/.cache/pip/wheels/66/f5/d7/f6ddd78b61037fcb51a3e32c9cd276e292343cdd62d5384efd Successfully built numpy 
like image 226
zjffdu Avatar asked Feb 02 '16 02:02

zjffdu


People also ask

How do I clear my pip cache?

If you want to force pip to clear out its download cache and use the specific version you can do by using --no-cache-dir command. If you are using an older version of pip than upgrade it with pip install -U pip. This will help you clear pip cache.

How much time does it take to install python?

Conclusion. We saw how easy it is to set up an environment for you to install Python on your computer. It does not take more than 5 minutes in the best case.


1 Answers

The slowness is due to compilation indeed. But there is now the manylinux tag. Which allows the installation of pre-compiled distributions. See for example the PyPI page of numpy to see if a manylinux package is provided for your Python version.

Update (2021-06)

Since this answer received some attention lately, there are now many manylinux tags for precompiled packages (no pun intended).

like image 61
code_onkel Avatar answered Sep 23 '22 12:09

code_onkel