python setuptool如何为libxml2-dev和libxslt1-dev添加依赖项? [英] python setuptool how can I add dependency for libxml2-dev and libxslt1-dev?

查看:266
本文介绍了python setuptool如何为libxml2-dev和libxslt1-dev添加依赖项?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序需要lxml> = 2.1, 但是要安装lxml,需要安装libxml2-dev libxslt1-dev 否则在安装lxml时会引发错误,

My application needs lxml >= 2.1, but to install lxml its requied to install libxml2-dev libxslt1-dev else it raises error while installing the lxml,

有没有一种方法可以使用python安装工具在我的setup.py中将其作为依赖项....​​

is there a way that using python setup tool I can give this as dependency in my setup.py....

推荐答案

不是真的... setuptools仅处理依赖于pypi的程序包的依赖项.因此,如果您想要这种依赖性,我认为您必须选择自己喜欢的发行版所带来的包装技术.

Not really ... setuptools only handle dependencies on package wich belongs already to pypi. So if you want these kind of dependencies, i think that you have to select the packaging technology brought by your favorite distribution.

但是,您可以在安装软件包之前覆盖setuptools build或install命令进行额外检查. 为此,请查看以下

But, you can override your setuptools build or install command to make extra check before installing the package. To do so, please have a look of this answer.

这篇关于python setuptool如何为libxml2-dev和libxslt1-dev添加依赖项?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆