1

I'm using setuptools to install a Python module that I'm working on. In addition to numpy, scipy, ..., whose presence I can assure with install_requires = [...], my module also depends on a Python module - let's call it specialmodule - that is a Python interface to a program that is neither an egg, nor a single .py-file or a VCS repo (so Dependencies that aren’t in PyPI is not applicable). The program is written in C++ and has a Python interface, and can either be built from source after cloning from git, or obtained as a tar archive.

Is there a way to use setuptools to check the existence of this module (which is in PYTHONPATH), and if it can not be found, display some message to the user that the module is missing (and if possible, also some instructions on how to get it)?

Edit: Also, if there is a more elegant way to do this with a different approach than with setuptools, I'd be glad to hear! But I would really like to check directly on installation, not during runtime of my module.

mindm49907
  • 278
  • 2
  • 10
  • A quick look through the documentation found [this](https://pythonhosted.org/setuptools/setuptools.html#dependencies-that-aren-t-in-pypi) - did you look at it already? – David Z Nov 10 '15 at 11:58
  • @DavidZ Yes I already saw that, but unfortunately, `specialmodule` is a Python interface to a program that is neither an egg, nor a single .py-file or a VCS repo. The program is written in C++ and has a Python interface, and can either be built from source after cloning from git, or obtained as a tar archive. – mindm49907 Nov 10 '15 at 13:20
  • That's fairly essential information to include in the question. (Actually a link to the actual module in question wouldn't hurt.) – David Z Nov 10 '15 at 13:41
  • What prevent you from creating an egg for `specialmodule` ? – Cyrbil Nov 10 '15 at 14:11
  • @Cyrbil This is not in my field of action, I would not want to have to provide new eggs for every new version of the program in addition to my software. I think I would rather try to `import specialmodule` during installtion, and give suggestions on what to do in case this fails. – mindm49907 Nov 10 '15 at 14:19
  • I was able to solve the task using a custom install command, see [this post](http://stackoverflow.com/questions/21915469/python-setuptools-install-requires-is-ignored-when-overriding-cmdclass). – mindm49907 Dec 21 '15 at 17:59

0 Answers0