tags:

views:

32

answers:

1

I'm using Windows XP.

When I double click the Launch_PyDemos.pyw from the book Programming Python, nothing happens. When I try to run Launch_PyDemos.pyw from command-line, I get the error message:

Traceback (most recent call last):
  File "PyDemos2.pyw", line 41, in <module>
    from PP3E.Gui.Tools.windows import MainWindow    # a Tk with icon, title, quit
ImportError: No module named PP3E.Gui.Tools.windows

When I set the PythonPath enviroment variable to the PP3E folder, nothing happens. When I append the PP3E folder to the Path enviroment variable, nothing happens. When I copy the PP3E directory tree to the site-packages folder in your Python source library, nothing happens.

What is going on?

+3  A: 

You're missing libraries from the book. Quoting a bytes thread:

Please follow the instructions on the book, or read the README-PP3E.txt file; below I copy the most relevant parts:

"""Copy the entire PP3E directory tree to some directory on your computer, and add the name of the directory containing PP3E to your module search path (i.e., you PYTHONPATH shell setting, ".pth" files, etc.).

Alternatively, copy the PP3E directory tree to the site-packages folder in your Python source library (e.g., C:\Python24\Lib\site-packages on Windows for Python 2.4). Because this directory is automatically searched on imports, copying here makes PYTHONPATH settings unnecessary."""

Also, make sure you get the updated version from http://examples.oreilly.com/python3/pp3e-updates.html

Oli
it still doesn't work :-(
Delirium tremens
If it's still failing with the same error, your environment isn't set up correctly. You're still missing the PP3E library which ships with the book. Don't follow those instructions blindly either. If you're using Python 2.6, you need to find where it keeps its site-packages (if you're copying)
Oli
Running from command-line is working, but running by double-clicking isn't working.
Delirium tremens
If double-click doesn't work you don't have the "File Associations" set up correctly in Windows. You must associate .pyw files with pythonw.exe.
S.Lott
thank you two! it works! :)
Delirium tremens