python - 使用 python 需求文件,您可以控制安装包依赖项的顺序吗?

通常你会希望所有的包都声明它们的依赖关系,但有时这是你无法控制的,对于大型或复杂的包来说“fork it”并不容易。

例如,SciPi 需要 NumPy,但没有指定它。那么对于您无法控制的包,有没有办法告诉 setup.py 或 pip 按特定顺序安装?

最佳答案

4/13/2015 更新:作为 @Garrrett commented,安装顺序行为在 pip v6.1.0 中发生了变化。取自 pip v7.0.0.dev0 docs :

As of v6.1.0, pip installs dependencies before their dependents, i.e. in "topological order". This is the only commitment pip currently makes related to order. While it may be coincidentally true that pip will install things in the order of the install arguments or in the order of the items in a requirements file, this is not a promise.


初始答案(已过时):

使用带有pip 的需求文件。自 0.8.3 版本以来,pip 按照需求文件中列出的顺序安装包。

https://stackoverflow.com/questions/11569660/

相关文章:

arrays - 确定网格上的点是否为 "trapped"(封闭)

python - 使用 Python 进行平台无关的文本散列

xml - 有没有比 <!ENTITY> 更好的方法来重用 DocBook 中的复杂表格?

regex - 基于预定义文本字符串的复杂正则表达式来阻止色情

hibernate - JPA/JPQL : AS identifier disallowed in

ruby-on-rails-3 - 将生成的图像文件保存为回形针附件

wix - 如何在不调用安装的情况下执行 MSI 中存在的自定义操作?

eclipse - 如何将当前 Eclipse 文本编辑器光标位置传递给外部工具?

ruby-on-rails - 页面加载完成后图像消失

python - 在 PyGame (SDL) 中使用 Cairo 时的字节顺序