Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
+1 vote
2 views
in Python by (47.6k points)

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?

3 Answers

–1 vote
by (106k points)

If you want to force pip to clear out its download cache and use the specific version you can do by using  --no-cache-dir  command. If you are using an older version of pip than upgrade it with pip install -U pip.

If you wish to know what is python visit this python tutorial and python interview questions.

0 votes
by (150 points)

pip3 cache purge worked for me.

0 votes
by (1.9k points)
For removing the pip's cache, we can use the command in command prompt or any command line terminal:

"pip cache purge"

This command basically helps in removing all the files from the wheel and all HTTP caches

Related questions

0 votes
4 answers
0 votes
4 answers
0 votes
1 answer
asked Feb 19, 2021 in Python by laddulakshana (16.4k points)

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...