← 返回命令列表

Linux command

pip-cache 命令

网络

复制后可按需替换文件名、目录或参数。

常用示例

Show cache directory

pip cache dir

List cached packages

pip cache list

Show cache info

pip cache info

Remove specific package from cache

pip cache remove [package]

Clear all cache

pip cache purge

说明

pip cache manages pip's HTTP-response cache and built-wheel cache. Pip stores downloaded and locally built wheels under a per-user cache directory (e.g. ~/.cache/pip on Linux, ~/Library/Caches/pip on macOS, %LocalAppData%\pip\Cache on Windows) so that subsequent installs of the same version can skip the network round-trip and the build step. To bypass the cache for a single install, use pip install --no-cache-dir _pkg_; to override the cache location, set the PIP_CACHE_DIR environment variable or pass pip --cache-dir _DIR_.

参数

dir
Print the cache directory path.
info
Show cache size and location.
list _pattern_
List wheels currently in the cache, optionally filtered by glob _pattern_ or package name.
remove _pattern_
Remove cached wheels matching _pattern_ (glob or package name).
purge
Remove every wheel and HTTP response from the cache.
--format _FORMAT_
Output format for list: human (default) or abspath (full file paths). Also configurable via PIP_FORMAT.

FAQ

What is the pip-cache command used for?

pip cache manages pip's HTTP-response cache and built-wheel cache. Pip stores downloaded and locally built wheels under a per-user cache directory (e.g. ~/.cache/pip on Linux, ~/Library/Caches/pip on macOS, %LocalAppData%\pip\Cache on Windows) so that subsequent installs of the same version can skip the network round-trip and the build step. To bypass the cache for a single install, use pip install --no-cache-dir _pkg_; to override the cache location, set the PIP_CACHE_DIR environment variable or pass pip --cache-dir _DIR_.

How do I run a basic pip-cache example?

Run `pip cache dir` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does dir do in pip-cache?

Print the cache directory path.