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
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.
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.
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.
Since this answer received some attention lately, there are now many manylinux tags for precompiled packages (no pun intended).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With