2

Given a pip requirements file, how do you update a local cache of Python packages without installing anything or unnecessarily re-downloading packages that are currently up to date?

I've tried:

pip install --download="packages" --exists-action=w -r pip-requirements.txt

However, it seems to automatically redownload everything, even if the correct version has already been downloaded. How do I prevent this?

Also, what's the difference between --download=DIR and --download-cache=DIR? The docs aren't very clear, and provided descriptions sound almost identical. It seems implied that specifying --download=DIR does not install anything whereas specifying --download-cache=DIR may or may not install anything.

4

1 回答 1

4

我认为这pip install -r pip-requirements.txt就是您所需要的,因为通常 pip 不会重新下载已安装的软件包。

即使你这样做,pip install --upgrade -r pip-requirements.txt我也希望它只会升级那些需要升级的东西。

你在里面工作virtualenv吗?那可能是你的问题。

于 2012-05-17T17:35:08.830 回答