python packages with dependency installation

Asked

Viewed 531 times

3

I wonder if as in packages . deb for example, it is possible in my setup.py i configure the dependencies for my package, and when running:

$ sudo python setup.py install

They are installed automatically. I’ve searched the internet but everything I found ended up leaving me confused, things like "requires", "install_requires" and "Reskirts.txt".

Thanks in advance.

2 answers

2


In his setup.py I’m sure you’re using a function setup() of settuptools. It shall include in that function the argument install_requires with the list of dependencies.

For example:

setup(
    name='exemplo',
    install_requires=[
        'babel >= 1.0',
        'pytz',
    ],
)

Clarifying the requirements.txt: is often used with pip to indicate a list of packages to install, instead of using this list directly on pip. It is not related to the setup.py, but ends up having a function similar to ìnstall_requires`, hence it can generate confusion.

0

Browser other questions tagged

You are not signed in. Login or sign up in order to post.