curses is not imported under Linux (and Python 2.4)

Discussion in 'Python' started by Konrad Koller, Jan 6, 2005.

  1. 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?
    Konrad Koller, Jan 6, 2005
    #1
    1. Advertising

  2. Konrad Koller

    Steve Holden Guest

    Konrad Koller wrote:

    > 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
    --
    Steve Holden http://www.holdenweb.com/
    Python Web Programming http://pydish.holdenweb.com/
    Holden Web LLC +1 703 861 4237 +1 800 494 3119
    Steve Holden, Jan 6, 2005
    #2
    1. Advertising

  3. Konrad Koller

    Craig Ringer Guest

    On Fri, 2005-01-07 at 00:38, Konrad Koller wrote:
    > 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.

    --
    Craig Ringer
    Craig Ringer, Jan 7, 2005
    #3
  4. 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
    Konrad Koller, Jan 9, 2005
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. bronby
    Replies:
    1
    Views:
    604
    Andrew Thompson
    Jul 15, 2005
  2. Jean-Paul Calderone
    Replies:
    2
    Views:
    436
    Joel Hedlund
    Feb 9, 2006
  3. Luke Kenneth Casson Leighton
    Replies:
    0
    Views:
    366
    Luke Kenneth Casson Leighton
    Jan 15, 2009
  4. Dun Peal
    Replies:
    10
    Views:
    456
    Chris Rebert
    May 3, 2011
  5. Volker Nicolai
    Replies:
    9
    Views:
    941
    Fabian Pilkowski
    Jul 4, 2005
Loading...

Share This Page