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
python -m pip config list

# Show effective pip configuration settings.

Set global index URL
python -m pip config set global.index-url https://pypi.org/simple

# Persist an index URL in pip config.

Set per-site config file value
python -m pip config --site set global.timeout 60

# Write a configuration value in the site config scope.

## Cache Management
Show cache directory
python -m pip cache dir

# Print pip’s cache location.

Show cache info
python -m pip cache info

# Display cache size and entry information.

List cache entries
python -m pip cache list

# List cached wheel or package files.

Remove cached package entries
python -m pip cache remove requests

# Delete cached entries for a package.

Purge entire cache
python -m pip cache purge

# Clear all cached pip artifacts.

## Debugging, Network, and Resolver
Run pip with verbose output
python -m pip install -vvv requests

# Increase output detail for troubleshooting.

Show pip debug information
python -m pip debug

# Print environment and compatibility diagnostics.

Increase network timeout
python -m pip install --default-timeout=120 -r requirements.txt

# Set a higher request timeout for slow networks.

Adjust retry count
python -m pip install --retries 10 requests

# Configure retry attempts for flaky network requests.

Disable cache for one install
python -m pip install --no-cache-dir requests

# Skip cache use while installing.

Recommended next

No recommendations yet.