Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pip install - do downloaded whl files persist & take disk space?

Tags:

python

pip

While installing packages with pip in python, it downloads and installs a whl file, e.g. following file for pyqt5:

https://files.pythonhosted.org/packages/d4/bf/d884da8e2f7096d201c891d515eb6813a8e85df5eb6f5e12e867bf1d831c/PyQt5-5.11.3-5.11.2-cp35.cp36.cp37.cp38-abi3-manylinux1_x86_64.whl

After installation, does this file persist on disc and take space?

If so, can it be removed to free space on disk?

Also, is there a link regarding this anywhere in documentations?

like image 743
rnso Avatar asked Jan 04 '19 17:01

rnso


2 Answers

Yes, it does. The wheels are stored at pip's caching folder. The location can be overriden via the --cache-dir parameter.

The default location for the cache directory depends on the Operating System:

Unix

~/.cache/pip and it respects the XDG_CACHE_HOME directory.

macOS

~/Library/Caches/pip.

Windows CSIDL_LOCAL_APPDATA>\pip\Cache

More information is available here: https://pip.pypa.io/en/latest/reference/pip_install/#caching

like image 191
Ramiro Berrelleza Avatar answered Oct 19 '22 18:10

Ramiro Berrelleza


In the case of PyQt5, the 117.8MB installation file is cached in the http directory of the pip cache, which Ramiro's answer includes the location of. You can safely remove both the http and wheels directories.

You can disable caching on future installations via the --no-cache-dir command line option (source).

like image 34
FThompson Avatar answered Oct 19 '22 16:10

FThompson