Pip需求文件:不安装依赖项

时间:2015-04-11 12:36:55

标签: python pip requirements.txt

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

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

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

1 个答案:

答案 0 :(得分:2)

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

pip install -r requirements.txt
pip install --no-deps -r no_deps.txt
相关问题