user559611
user559611

Reputation:

curses library import error pypy

I have been using pypy 1.4 which is said to be fully compatible with cpython 2.5 but when I try to import the curses module, I get an import error evn though the curses module is available.Any pointers why this may be happening?

Upvotes: 1

Views: 1357

Answers (2)

Tobu
Tobu

Reputation: 25416

Here is the bug report.

Upvotes: 1

tzot
tzot

Reputation: 95911

The curses Python module uses the _curses C module. The PyPy Python compatibility page says the following (with points emphasized by me):

PyPy implements the Python language version 2.5. It supports all of the core language, passing Python test suite (with minor modifications that were already accepted in the main python in newer versions). It supports most of the commonly used Python standard library modules; details below.

PyPy has alpha-level support for the CPython C API, however, as of 1.4.1 release this feature is not yet complete. Most libraries will require a bit of effort to work, but there are known success stories. Check out PyPy blog for updates.

C extensions need to be recompiled for PyPy in order to work. Depending on your build system, it might work out of the box or will be slightly harder. In order to instruct pypy to load a CPython extension (compiled with supplied Python.h), run following line:

import cpyext

Further down that page, there is a list of standard library modules supported by PyPy. I don't see curses there, although there is a _minimal_curses which might be of use to you.

Upvotes: 3

Related Questions