Where is pip's cache when using a virtual environment? Is it the default cache? If so, won't those downloaded packages/wheels remain if you delete the virtual environment?
Enabling the local cache of pip First open the pip configuration file located at ~/. pip/pip. conf with your preferred text editor . %HOME%\pip\pip.
On Unix and macOS the file is $VIRTUAL_ENV/pip. conf. On Windows the file is: %VIRTUAL_ENV%\pip. ini.
pip is a tool for installing packages from the Python Package Index. virtualenv is a tool for creating isolated Python environments containing their own copy of python , pip , and their own place to keep libraries installed from PyPI.
To create a virtual environment, go to your project's directory and run venv. If you are using Python 2, replace venv with virtualenv in the below commands. The second argument is the location to create the virtual environment. Generally, you can just create this in your project and call it env .
Pip uses the default cache indeed, whether you're working inside a virtualenv or not. This indeed means that after removing your virtualenv, any pip cache related to it is not removed.
Mind that the installed packages themselves are deleted, just not the download cache.
Why would that be a problem? I think this is expected behaviour, since you gain an advantage when installing the same package in another virtualenv later on.
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