OH, I'm A Lumberjack And I'm OK...

David Oppenheimer davidopp at megsinet.net
Fri Sep 3 02:31:55 EDT 1999


OK, I lied, here's yet another post in my continuing struggle to run painter.py

I took Robin's PYTHONPATH suggestion and now my traceback is as follows:

>>> Traceback (innermost last):
  File "C:\Python\Pythonwin\pywin\framework\scriptutils.py", line 237, in
RunScript
    exec codeObject in __main__.__dict__
  File "C:\Python\scripts\painter.py", line 65, in ?
    im = Image.open(sys.argv[1])
IndexError: list index out of range

I have now gotten to line 65 before I get an error (this is a tremendous
improvement of 53 lines more of code processed before an error kills the
program).

All Hail Robin Dunn, Master of wxPython and all around troubleshooter.  Got any
ideas what the heck this last error means Robin?

David O.


Robin Dunn wrote:

> >
> > PATHS     (yes, I took the suggestion to place my Python & related files
> in
> > pathways that have no spaces)
> >
> > Path to Python executable: C:\Python
> > Path to Tcl executable: C:\Tcl\bin
> > Path to PIL: C:\Python\PIL
> > Path to Tkinter: C:\Python\Lib\lib-tk
> > Path to Painter (a program that I am more than curious to see work, I am
> almost
> > obsessed now): C:\Python\scripts\painter.py
> >
> > My Traceback (error message):
> >
> > >>> Traceback (innermost last):
> >   File "C:\Python\Pythonwin\pywin\framework\scriptutils.py", line 237, in
> > RunScript
> >     exec codeObject in __main__.__dict__
> >   File "C:\Python\scripts\painter.py", line 12, in ?
> >     import Image, ImageTk
> > ImportError: No module named Image
> >
> > My Autoexec.bat settings:
> >
> > PATH=C:\WINDOWS;C:\WINDOWS\COMMAND;C:\WINDOWS;
> > set PATH=%PATH%C:\mingw32\bin;
> > set PATH=%PATH%C:\PYTHON;C:\PYTHON\PIL;C:\TCL\BIN;C:\PYTHON\LIB\LIB-TK;
> >
>
> It can't find the module because it's not on the PYTHONPATH.  Execute this
> python code to see what directories are in your PYTHONPATH:
>
> import sys
> print sys.path
>
> To fix it add this to your autoexec.bat:
>
> set PYTHONPATH=c:\Python\PIL
>
> or add the directory to the value in the Registry at
>
> HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\1.5\PythonPath
>
> or as a subkey.
>
> --
> Robin Dunn
> Software Craftsman
> robin at AllDunn.com
> http://AllDunn.com/robin/
> http://AllDunn.com/wxPython/  Check it out!





More information about the Python-list mailing list