创建虚拟环境时,pip 是否每次都重新安装库?

does pip reinstall libraries everytime when creating a virtual environment?

我知道这听起来可能很愚蠢,但我真的尽力了解 pip 是每次都从互联网安装软件包,还是在我创建 venv 时它只是克隆并使用已经全局安装的软件包?

pip install 和 pip download 到底有什么区别?

是什么意思

正在收集包...

使用缓存 ...

正在下载

谁能帮帮我...

pip download 替换了 pip install 的 --download 选项,该选项现已弃用并在 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.

The idea behind the pip cache is simple, when you install a Python package using pip for the first time, it gets saved on the cache. If you try to download/install the same version of the package on a second time, pip will just use the local cached copy instead of retrieving it from the remote register .

如果您打算在另一个项目中使用 相同版本 的包,那么使用缓存的包要快得多。

但是如果 pip 安装了包的缓存版本并且你想升级到包的最新版本那么你可以简单地升级:pip install <package_name> --upgrade