1

I have a python package called 'lib-package'. This python package has a bunch of other python packages listed in the requirements.txt.

Now I need to use 'lib-package' in my other python project called 'other-project'. The problem is that the while doing pip install inside 'other-project', the 'lib-package' is installed, but its dependencies are not installed.

How do I make pip recursively install the dependencies of 'lib-package'?

  • 2
    Create a `setup.py` and define the dependencies in it. https://docs.python.org/3/distutils/setupscript.html – Klaus D. Jun 30 '21 at 13:22
  • 3
    https://packaging.python.org/tutorials/packaging-projects/ – FloLie Jun 30 '21 at 13:23
  • 1
    Example here https://github.com/avinassh/rockstar/blob/master/setup.py#L11,#L19 – FloLie Jun 30 '21 at 13:25
  • @FloLie, But isn't the `install_requires` argument meant to inform the package users regarding which versions of the dependencies are expected to work? – Saroopashree Kumaraguru Jun 30 '21 at 13:28
  • 3
    https://packaging.python.org/guides/distributing-packages-using-setuptools/#install-requires: "*When the project is installed by pip, this is the specification that is used to install its dependencies.*" – Gino Mempin Jun 30 '21 at 13:49
  • Does this answer your question? [When to use pip requirements file versus install_requires in setup.py?](https://stackoverflow.com/q/6947988/2745495) – Gino Mempin Jun 30 '21 at 23:11

0 Answers0