Creating a program in Python 3 for Windows users, cannot use PIL? -



Creating a program in Python 3 for Windows users, cannot use PIL? -

i wrote simple gui programme automate few processes windows users in python (as programming language familiar run on windows). ideally not want user have run install programme on machine, plan run self-contained in usb drive.

it depends on os, shutil, string, sys, tkinter, webbrowser, pil, ftplib, , glob.

it seems though of dependencies got imported when ran cx_freeze on it, except pil. have never used cx_freeze before, doing wrong doesn't seem it. running programme unfrozen .py script works fine.

here's error message receive when trying utilize pil command:

exception in tkinter callback traceback (most recent phone call last): file "c:\python32\lib\tkinter\__init__.py", line 1399, in __call__ homecoming self.func(*args) file "e:\albumuploader.py", line 143, in onbutton2click img.thumbnail(size, image.antialias) file "c:\python32\lib\site-packages\pil\image.py", line 1573, in thumbnail self.load() file "c:\python32\lib\site-packages\pil\imagefile.py", line 168, in load self.load_prepare() file "c:\python32\lib\site-packages\pil\imagefile.py", line 234, in load_prepare self.im = image.core.new(self.mode, self.size) file "c:\python32\lib\site-packages\pil\image.py", line 39, in __getattr__ raise importerror("the _imaging c module not installed") importerror: _imaging c module not installed

thanks help can provide. see it's still referencing c:\python32 part of problem, because shouldn't (if i'm not mistaken).

update:

i looked @ pil faq , seems gist of reply need create sure sys.path list correct. grabbed python files windows , included in usb drive trying utilize contain everything, , set path so:

program_dir = os.path.split(sys.argv[0])[0] sys.path = [program_dir] sys.path.append(program_dir + os.sep + 'lib') sys.path.append(program_dir + os.sep + 'lib' + os.sep + 'site-packages') sys.path.append(program_dir + os.sep + 'lib' + os.sep + 'site-packages' + os.sep + 'pil') sys.path.append(program_dir + os.sep + 'dlls')

all paths seem correct, reason still getting same error. when run .py file works 100%, seems break somehow. other modules seem work fine shutil, os, , sys, example.

i think main problem may python imaging library (pil) not yet back upwards python 3.x.

if @ pil downloads page you'll see there windows downloads python 2.4, 2.5, 2.6 , 2.7 nil python 3.x.

this question has reply details unofficial ports of pil python 3.x might worth try.

if works take @ the first question on pil faq "the _imaging c module not installed" error , lists various things can identify problem.

python windows python-imaging-library cx-freeze

Comments

Popular posts from this blog

How do I check if an insert was successful with MySQLdb in Python? -

delphi - blogger via idHTTP : error 400 bad request -

postgresql - ERROR: operator is not unique: unknown + unknown -