user3848207
user3848207

Reputation: 4967

What are some pip commands to remove excess space stored by pip installation?

Are there pip commands, if any, to remove excessive space caused by pip installations without affecting operations of existing packages?

I am using python 3.7

Upvotes: 5

Views: 9936

Answers (2)

The_O
The_O

Reputation: 563

As of pip 20.1, you can just use pip cache purge Check one of the pip maintainers' SO answer here.

Upvotes: 15

Simba
Simba

Reputation: 27698

Cleaning up cache is not built in pip command. You have to clean the cache folder manually.

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

For example,

# clean up cache on Linux
rm -rf ~/.cache/pip

References

Upvotes: 3

Related Questions