python - pip缓存文件夹在哪里?

标签 python pip

Python pip 缓存文件夹在哪里?我在安装过程中出错,现在使用缓存文件重新安装包。那个目录在哪里?我想备份它们以备将来安装。有可能吗?

比如我有这个

Using cached cssselect-0.9.1.tar.gz

我在 google 上搜索过这个目录,但没有看到,正在学习如何从文件夹安装,我想找到默认的缓存目录。

还有一个问题:这些缓存文件会保留在那个目录中,还是会很快被删除?

最佳答案

The default location for the cache directory depends on the Operating System:

Unix

~/.cache/pip and it respects the XDG_CACHE_HOME directory.

macOS

~/Library/Caches/pip

Windows

<CSIDL_LOCAL_APPDATA>\pip\Cache

Wheel Cache

pip will read from the subdirectory wheels within the pip cache directory and use any packages found there. [snip]

https://pip.pypa.io/en/latest/reference/pip_install/#caching

缓存目录的位置可以通过命令行选项--cache-dir来改变.

关于python - pip缓存文件夹在哪里?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34578168/

相关文章:

python - FPDF 在 Python 中生成空页

python - 无法从 mysql-utilities : "No module named mysql.utilities.common.tools" 运行任何东西

python - Django 响应没有内容 - 如何调试?

python - UnboundLocalError - 赋值前引用的局部变量 - Django

python : defaultdict every value is updated

python - 如何通过flask web app安装第三方模块和库

python - 如何判断是否安装了 Python setuptools?

python - 无法将 Django 连接到 M1 mac 上的现有 MySQL 数据库

python - virtualenv 上的 pip install requests[security] 无法构建密码学和 cffi 轮子

python - 如果 PyPI 存在依赖关系,Pip 会忽略从 wheel 安装包的 dependency_links