2

I have written a script in python that I would like to be able to give to some less tech-savvy friends. However, it relies on PIL and requests to function. How can I include these modules without forcing my friends to try to install them?

asked Dec 28, 2012 at 10:45
1
  • Did you try setuptools / distutils etc.? Commented Dec 28, 2012 at 10:51

3 Answers 3

2

They have to install them one way or another, but there are various ways of doing so. Which one depends on how they install your script.

  • If they install your script with distribute, you can simply add PIL (or better Pillow) as an install dependency.

  • If they install your script with an installer (exe or msi) then include PIL in that installer.

  • If they install your script by just copying it somewhere, then your script will have to check if PIL is installed, and if not, install it, as the first thing it does before it tries to import it.

answered Dec 28, 2012 at 11:10
Sign up to request clarification or add additional context in comments.

Comments

2

Take a look at PyInstaller - http://www.pyinstaller.org/

This allows for the creation of a simple installer which incorporates all required packages.

PIL is listed as a supported package - http://www.pyinstaller.org/wiki/SupportedPackages

answered Dec 28, 2012 at 11:41

Comments

-1

It's simple. Make them to put your script in site-packages or dist-packages. They can import the script using import module and use them.

answered Dec 28, 2012 at 11:37

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.