找出 Python 中的依赖项来自哪里?
当我运行 pip install . 时,我安装了所有依赖项,包括传递依赖项,但问题是有两个模块依赖于两个不同版本的 lxml。如何使用 pip
或任何其他工具找出谁需要什么?
When I run pip install .
I get all dependencies installed, including transitive dependencies, but the problem is that there are two modules that depend on two different versions of lxml. How can I figure out who is requiring what with pip
or any other tool?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您知道哪些模块依赖于 lxml 吗?如果是这样,您只需检查这些模块 setup.py 文件并检查
install_requires
,大多数包创建者也会包含版本号。例如来自: https://github.com/disqus/gargoyle/blob/master/ setup.py
你可能还想研究一下 modulefinder 之类的东西,但我认为只是检查在这种情况下,setup.py 更容易。
Do you have an idea of which modules depend on lxml? If so, you could simply check those modules setup.py files and check
install_requires
, and most package creators will include the version number as well. e.g.From: https://github.com/disqus/gargoyle/blob/master/setup.py
You may also want to look into something like modulefinder but I think simply checking the setup.py is much easier in this case.