[IPython-user] Crash

Fernando Perez fperez at colorado.edu
Thu Mar 27 17:03:06 CST 2003


Ok, there's something seriously strange here going on.  Your output is:

>>>>import curses
> 
> Traceback (most recent call last):
>   File "<stdin>", line 1, in ?
>   File "C:\Python22\lib\curses\__init__.py", line 15, in ?
>     from _curses import *
> ImportError: No module named _curses

But here's the code which is crashing ipython:

     838     # auto-determine screen size
     839     if screen_lines <= 0:
     840         try:
     841             import curses
--> 842             scr = curses.initscr()
         scr = undefined, curses = <module 'curses' from 
'C:\Python22\lib\curses\__init__.pyc'>, global initscr = undefined
     843             screen_lines_real,screen_cols = scr.getmaxyx()


Which means that the 'import curses' statement _was_ executed by ipython 
without triggering the ImportError exception.  I don't understand how that is 
even possible to begin with.

My python2.2 installation doesn't even have the curses\ directory, for some 
odd reason.

Could you try doing

In [1]: import curses

In [2]: print curses.__file__
/usr/lib/python2.2/curses/__init__.pyc

in an IPython session?  I'd like to see if for some strange reason under 
ipython the ImportError isn't triggered.

This one is rather misterious.

Cheers,

f




More information about the IPython-user mailing list