python - Pip 要求文件 : do not install dependencies

标签 python pip requirements.txt

我正在使用一些 github django 包的前沿版本,它们具有我不想安装的依赖项。

在开发中,在我自己的计算机上,我可以在命令行中使用 pip install 并使用 --no-dependencies 标志。但是,我的测试和生产环境需要一个用于部署目的的需求文件。不幸的是,--no-dependencies 标志不能在需求文件中使用,如下所述:https://pip.pypa.io/en/latest/reference/pip_install.html#requirements-file-format .

有没有办法告诉 pip 在使用需求文件时不要安装依赖项?

最佳答案

我通过使用两个需求文件并调用 pip 两次来解决这个问题。

pip install -r requirements.txt
pip install --no-deps -r no_deps.txt

关于python - Pip 要求文件 : do not install dependencies,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29577939/

相关文章:

python - 在xlsx writer中通过散点图绘制线

python - 如何使用 pip 更新 Python 标准库包?

python - 自动创建 requirements.txt

python - 绘制故障线而不将每条线连接在一起

python - 为什么在 google colab 中找不到模块?

pip - 如何组织我的 python 模块和包

python - 在 macOS Sierra 上安装 pip

python - 降低要求.txt

python - 创建临时压缩文件

python - pip 可编辑安装在只读文件系统上