gpt4 book ai didi

pip - pip install 和 pip download 有什么区别?

转载 作者:行者123 更新时间:2023-12-03 19:37:56 28 4
gpt4 key购买 nike

pip install 和 pip download 有什么区别?

$ pip --version
pip 9.0.1 from c:\users\nahawk\python\python27\lib\site-packages (python 2.7)

我做了一个 diff on the help for the 2 commands它不是很有帮助。不幸的是,这些选项的排列顺序略有不同,这使它们看起来与实际情况大不相同。
pip help download
pip help install

最佳答案

我在 online docs for pip download 中找到了答案.

IMO,其中一些应在帮助中说明(即在说明中)。不然怎么知道怎么用,用pip help download ?

pip download replaces the --download option to pip install, which is now deprecated and will be removed in pip 10.

pip download does the same resolution and downloading as pip install, but instead of installing the dependencies, it collects the downloaded distributions into the directory provided (defaulting to the current directory). This directory can later be passed as the value to pip install --find-links to facilitate offline or locked down package installation.

pip download with the --platform, --python-version, --implementation, and --abi options provides the ability to fetch dependencies for an interpreter and system other than the ones that pip is running on. --only-binary=:all: is required when using any of these options. It is important to note that these options all default to the current system/interpreter, and not to the most restrictive constraints (e.g. platform any, abi none, etc). To avoid fetching dependencies that happen to match the constraint of the current interpreter (but not your target one), it is recommended to specify all of these options if you are specifying one of them. Generic dependencies (e.g. universal wheels, or dependencies with no platform, abi, or implementation constraints) will still match an over- constrained download requirement.

关于pip - pip install 和 pip download 有什么区别?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45514948/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com