Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Removing pip's cache?

Tags:

python

pip

I need to install psycopg2 v2.4.1 specifically. I accidentally did:

 pip install psycopg2 

Instead of:

 pip install psycopg2==2.4.1 

That installs 2.4.4 instead of the earlier version.

Now even after I pip uninstall psycopg2 and attempt to reinstall with the correct version, it appears that pip is re-using the cache it downloaded the first time.

How can I force pip to clear out its download cache and use the specific version I'm including in the command?

like image 700
Geuis Avatar asked Mar 01 '12 04:03

Geuis


People also ask

Is it OK to delete pip cache?

It is safe to delete the user cache directory. It will simply cause pip to re-download all packages from PyPI.

How do I disable pip cache?

pip's caching behaviour is disabled by passing the --no-cache-dir option.

Can I delete root cache pip HTTP?

cache directory, for example for pip to install desired version of package. Yes you can delete all of . cache with no long term detrimental effects.

How do I clean my pip?

Uninstalling/removing Python packages using Pip To uninstall, or remove, a package use the command '$PIP uninstall <package-name>'. This example will remove the flask package.


1 Answers

If using pip 6.0 or newer, try adding the --no-cache-dir option (source).

If using pip older than pip 6.0, upgrade it with pip install -U pip.

like image 135
sholsapp Avatar answered Oct 14 '22 07:10

sholsapp