How can you install a package via pip without using the local cache?

Python interview question for Advanced practice.

Answer

pip install --no-cache-dir <package

Explanation

The --no-cache-dir flag forces pip to download the package from the index even if it exists in the local cache.

Related Questions