curses: AttributeError: initscr

Peter Hansen peter at engcorp.com
Mon Sep 2 02:27:31 EDT 2002


Gerhard Häring wrote:
> 
> * Cesar <g0w1s0 at yahoo.ca> [2002-09-01 22:22 -0400]:
> > in the same directory where my script live, there was an old file named
> > curses.py. Then the instruction : "import curses" imported the bad one...
> 
> You're not the first one to have this kind of problem.

Too true. :)

> A way to debug such problems is to start Python with the option "-v" or
> even "-vv", which helps you track down where modules are really loaded
> from.

The first thing I generally do, since I'm inevitably testing something
like this out at the interactive prompt, is to as for "module.__file__"
and see where the file I'm importing is really coming from.  I've
been surprised on more than one occasion.

-Peter



More information about the Python-list mailing list