python setuptool how can I add dependency for libx

2019-06-07 06:20发布

问题:

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,

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

回答1:

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.

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.