诅咒库导入错误pypy

2024-10-01 17:36:23 发布

您现在位置:Python中文网/ 问答频道 /正文

我一直在使用pypy1.4,据说它与cpython2.5完全兼容,但是当我试图导入curses模块时,我得到了一个导入错误evn,尽管curses模块是有空。有吗为什么会发生这种情况?在


Tags: 模块错误情况cursesevn
2条回答

cursesPython模块使用_cursesC模块。 PyPy Python compatibility page表示以下内容(我强调了几点):

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

再往下看,有一个PyPy支持的标准库模块列表。我看不到curses,尽管有一个_minimal_curses,可能对你有用。在

相关问题 更多 >

    热门问题