문제

As you may be aware, there are more than Python module with the name daemon. The version that I would like to make sure is installed is from the package python-daemon as opposed to, for example daemon.

In my setup.py file, I have:

setup(
    install_requires=['python-daemon']
)

However, if I run python setup.py install (as root of course), when the daemon package is already installed, python-daemon does not get installed.

Is there a way to make this work as I would like it to, or at least some sort of work around?

도움이 되었습니까?

해결책

It is unfortunate that both projects picked a generic name. This makes it almost impossible to correctly specify which one you need to install.

A workaround would be to specify a minimum version; python-daemon is up to version 1.5.5 at the time of writing, while daemon only ever released version 1.0, over 3 years ago.

Pin your requirement to 1.5 and newer and setuptools will go looking for python-daemon even if daemon is installed:

setup(
    install_requires=['python-daemon >= 1.5']
)

This workaround will fail, of course, the day daemon releases a 1.5 or newer version.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top