Using third-party libraries in Python

I am currently writing a simple Python program (2.7) using the Python Image Library . How can I make my program portable so that I can work on another computer (on which PIL is not already installed).

I studied the creation of the setup.py file, but I'm not sure if this is on the right track.

+4
source share
1 answer

OK, it seems that setup.py is the right way - you already have the setup () function, add an install_requires entry, for example:

setup( name="mypkg", version="0.0.1", # etc etc blah blah blabh install_requires=["PIL"], ) 

It should be! When your users run setup.py install, it will download the PIL and run its own PIL installation procedure.

+3
source

Source: https://habr.com/ru/post/1390816/


All Articles