Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where is pip's cache in a virtualenv?

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?

like image 650
jpm Avatar asked Sep 21 '17 17:09

jpm


People also ask

Where is pip cache stored?

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.

Where is pip config in VENV?

On Unix and macOS the file is $VIRTUAL_ENV/pip. conf. On Windows the file is: %VIRTUAL_ENV%\pip. ini.

What is pip in virtualenv?

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.

How do I enable pip in virtual environment?

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 .


1 Answers

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.

like image 182
Bart Van Loon Avatar answered Sep 21 '22 03:09

Bart Van Loon