【问题标题】:Pypy3 pip install recordclassPypy3 pip 安装记录类
【发布时间】:2021-04-14 15:40:56
【问题描述】:

尝试将 pip install recordclass (0.14.3) 模块安装到我的 pypy3 (PyPy 7.3.4-alpha0 with GCC 7.3.1 20180303 (Red Hat 7.3.1-5)) virtualenv 但遇到问题。有没有办法安装这个?还是这个库目前不支持pypy?

小sn-p的错误是:

 1024 |     _PyUnicodeWriter_Dealloc(&writer);
          |     ^~~~~~~~~~~~~~~~~~~~~~~~
    lib/recordclass/_dataobject.c: In function 'dataobjectiter_reduce':
    lib/recordclass/_dataobject.c:2032:39: warning: implicit declaration of function '_PyObject_GetBuiltin'; did you mean 'PyObject_GetBuffer'? [-Wimplicit-function-declaration]
     2032 |         return Py_BuildValue("N(O)n", _PyObject_GetBuiltin("iter"),
          |                                       ^~~~~~~~~~~~~~~~~~~~
          |                                       PyObject_GetBuffer
    lib/recordclass/_dataobject.c: In function 'PyInit__dataobject':
    lib/recordclass/_dataobject.c:2916:9: warning: implicit declaration of function 'PyState_FindModule' [-Wimplicit-function-declaration]
     2916 |     m = PyState_FindModule(&dataobjectmodule);
          |         ^~~~~~~~~~~~~~~~~~
    lib/recordclass/_dataobject.c:2916:7: warning: assignment to 'PyObject *' {aka 'struct _object *'} from 'int' makes pointer from integer without a cast [-Wint-conversion]
     2916 |     m = PyState_FindModule(&dataobjectmodule);
          |       ^
    error: command 'gcc' failed with exit status 1

【问题讨论】:

    标签: python pip pypy


    【解决方案1】:

    我打开了一个问题https://foss.heptapod.net/pypy/pypy/-/issues/3438。但是,如果提高性能是您的目标,那么对于 PyPy,recordclass 可能是错误的工具。它使用在 PyPy 上运行缓慢的(无限)C-API。使用命名元组可能会更好。

    【讨论】:

    • 谢谢!是的,这是我的目标,我知道 pypy 中的 c api 调用很慢,但无论如何都想尝试一下。再次感谢
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-02-09
    • 2020-06-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多