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.

Was it helpful?

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
scroll top