如何使用 Python 的 pip 下载并保存包的压缩文件? [英] How to use Python's pip to download and keep the zipped files for a package?
问题描述
如果我想使用 pip
命令下载一个包(及其依赖项),但保留下载的所有压缩文件(例如,django-socialregistration.tar.gz) - 有没有办法做到这一点?
If I want to use the pip
command to download a package (and its dependencies), but keep all of the zipped files that get downloaded (say, django-socialregistration.tar.gz) - is there a way to do that?
我尝试了各种命令行选项,但它似乎总是解压并删除 zipfile - 或者它获取 zipfile,但仅用于原始包,而不是依赖项.
I've tried various command-line options, but it always seems to unpack and delete the zipfile - or it gets the zipfile, but only for the original package, not the dependencies.
推荐答案
pip install --download
已弃用.从版本 8.0.0 开始,您应该使用 pip download
命令:
pip install --download
is deprecated. Starting from version 8.0.0 you should use pip download
command:
pip download <package-name>
这篇关于如何使用 Python 的 pip 下载并保存包的压缩文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!