curses is not imported under Linux (and Python 2.4)

K

Konrad Koller

import curses
produces the ImportError: No module named _curses
("from _curses import *" in line 15 in __init__.py)
Of course imp.find_module ("_curses") reports the same error.
How can I make use of the curses package for writing a Python script
with curses?
 
S

Steve Holden

Konrad said:
import curses
produces the ImportError: No module named _curses
("from _curses import *" in line 15 in __init__.py)
Of course imp.find_module ("_curses") reports the same error.
How can I make use of the curses package for writing a Python script
with curses?

I get the same thing under Windows: _curses is the compiled extension
supporting the curses library, so I must presume that isn't supported by
default on Windows.

No problems under Cygwin or on Linux.

Googling for "python curses windows" might provide a few pointers.

regards
Steve
 
C

Craig Ringer

import curses
produces the ImportError: No module named _curses
("from _curses import *" in line 15 in __init__.py)
Of course imp.find_module ("_curses") reports the same error.
How can I make use of the curses package for writing a Python script
with curses?

What Linux distro?
Is the Python version you're running one you compiled, one that shipped
with the distro, or a 3rd party RPM?

At a guess, I'd say you compiled it yourself and you don't have the
ncurses development packages (providing the ncurses header files and
static libs) installed.
 
K

Konrad Koller

Thanks for your hint.
What Linux distro? SuSE 9.1
Is the Python version you're running one you compiled, one that shipped
with the distro, or a 3rd party RPM?
compiled with Python-2.4.tar.bz2
At a guess, I'd say you compiled it yourself and you don't have the
ncurses development packages (providing the ncurses header files and
static libs) installed.
see above, but I did not exclude anything, it was a totally normal
run.
I did the same installation of Python2.4 on a different computer with
Fedora2 and found there the _curses.so and _curses_panel.so in
lib-dynload, which I missed in SuSE Linux, although under SuSE the
curses package was present in Lib. I don't understand this strange
behavior between the two installations.
After having the 2 mentioned static libs transfered from the "Fedora
computer" to the the "SuSE computer" the curses worked fine under
SuSE linux

Konrad Koller
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,818
Latest member
Brigette36

Latest Threads

Top