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?
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
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).
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