【问题标题】:Find where dependencies are coming from in Python?在 Python 中查找依赖项来自何处?
【发布时间】:2011-11-17 07:06:08
【问题描述】:

当我运行pip install . 时,我安装了所有依赖项,包括传递依赖项,但问题是有两个模块依赖于两个不同版本的 lxml。我如何使用pip 或任何其他工具确定谁需要什么?

【问题讨论】:

    标签: python dependencies setuptools pip


    【解决方案1】:

    你知道哪些模块依赖于 lxml 吗?如果是这样,您可以简单地检查这些模块 setup.py 文件并检查 install_requires,大多数包创建者也会包含版本号。例如

      install_requires=[
        'django-modeldict>=1.1.6',
        'nexus>=0.1.7',
        'django-jsonfield',
      ],
    

    发件人:https://github.com/disqus/gargoyle/blob/master/setup.py

    您可能还想查看modulefinder 之类的内容,但我认为在这种情况下只需检查 setup.py 会容易得多。

    【讨论】:

      猜你喜欢
      • 2012-12-19
      • 2015-06-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-05-24
      • 2017-01-07
      • 2011-02-12
      相关资源
      最近更新 更多