Using 3rd Party Libraries in Python
-
27-10-2019 - |
Question
I'm currently writing a simple Python (2.7) program using the Python Image Library. How can I make my program portable, so that I can run in on another computer (that doesn't already have PIL installed).
I've looked into creating a setup.py file, but I'm not sure this is on the right track.
Solution
OK, sounds like setup.py is the right way to go here - you should already have a setup() function in it, add an install_requires entry like so:
setup(
name="mypkg", version="0.0.1",
# etc etc blah blah blabh
install_requires=["PIL"],
)
That should do it! When your users run setup.py install, it will download PIL & run PIL's own installation routine.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow