Question

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?

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top