I wonder if as well as .deb packages for example, it is possible in my setup.py I configure the dependencies for my package, and run:
$ sudo python setup.py install
They are installed automatically. Already researched the internet but all I found out just leaving me confused, things like "requires", "install_requires" and "requirements.txt"
Just create
requirements.txtin your lib folder and add all dependencies like this:Then create a
setup.pyscript and readrequirements.txt:The execution of
python setup.py installwill install your package and all dependencies. Like @jwodder said it is not mandatory to create arequirements.txtfile, you can just setinstall_requiresdirectly in thesetup.pyscript. But writing arequirements.txtfile is a best practice.In the
setupfunction call, you also have to setversion,packages,author, etc, read the doc for a complete example: https://docs.python.org/3/distutils/setupscript.htmlYour package directory should look like this: