pip Config, Cache, and Debugging Cheat Sheet

pip configuration, cache management, network troubleshooting, verbose logs, and environment diagnostics.

View
StandardDetailedCompact
Export
Copy the compact sheet, download it, or print it.
Download
`D` dense toggle · `C` copy all

Configuration

List pip configuration values

Show effective pip configuration settings.

bashANYconfiginspect
bash
python -m pip config list
Notes

Useful when debugging unexpected index URLs, trusted hosts, or cache behavior.

Set global index URL

Persist an index URL in pip config.

bashANYconfigindex-urlglobal
bash
python -m pip config set global.index-url https://pypi.org/simple
Notes

Writes a persistent config value so you do not need to pass `--index-url` each time.

Set per-site config file value

Write a configuration value in the site config scope.

bashANYconfigtimeoutsite
bash
python -m pip config --site set global.timeout 60
Notes

Scope lets you target site, user, or global config files.

Cache Management

Show cache directory

Print pip’s cache location.

bashANYcacheinspect
bash
python -m pip cache dir
Notes

Helpful when inspecting what pip has cached between runs.

Show cache info

Display cache size and entry information.

bashANYcacheinfo
bash
python -m pip cache info
Notes

Useful for CI tuning and disk usage review.

List cache entries

List cached wheel or package files.

bashANYcachelist
bash
python -m pip cache list
Notes

Lets you inspect which packages are already cached locally.

Remove cached package entries

Delete cached entries for a package.

bashANYcacheremove
bash
python -m pip cache remove requests
Notes

Useful if you suspect a stale or corrupted cached artifact.

Purge entire cache

Clear all cached pip artifacts.

bashANYcachepurgecleanup
bash
python -m pip cache purge
Notes

A broad reset option when debugging package caching problems.

Debugging, Network, and Resolver

Run pip with verbose output

Increase output detail for troubleshooting.

bashANYverbosedebuggingresolver
bash
python -m pip install -vvv requests
Notes

Three `v` flags surface detailed resolver and download logs.

Show pip debug information

Print environment and compatibility diagnostics.

bashANYdebugdiagnosticsenvironment
bash
python -m pip debug
Notes

Useful for investigating interpreter tags, platforms, and config behavior.

Increase network timeout

Set a higher request timeout for slow networks.

bashANYtimeoutnetworkinstall
bash
python -m pip install --default-timeout=120 -r requirements.txt
Notes

Helpful when downloads fail due to slow or unstable connectivity.

Adjust retry count

Configure retry attempts for flaky network requests.

bashANYretriesnetworkresilience
bash
python -m pip install --retries 10 requests
Notes

Useful in unreliable CI networks or remote environments.

Disable cache for one install

Skip cache use while installing.

bashANYcachenetworkdebugging
bash
python -m pip install --no-cache-dir requests
Notes

Helpful when verifying fresh downloads or working around a cache issue.

Recommended next

No recommendations yet.