Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/django/19.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
导入ctypes python模块时出错-运行时错误:ffi_prep_闭包失败,错误为2_Python_Django_Python 2.7_Ctypes_Linux Toolchain - Fatal编程技术网

导入ctypes python模块时出错-运行时错误:ffi_prep_闭包失败,错误为2

导入ctypes python模块时出错-运行时错误:ffi_prep_闭包失败,错误为2,python,django,python-2.7,ctypes,linux-toolchain,Python,Django,Python 2.7,Ctypes,Linux Toolchain,导入ctype python模块时,我遇到以下错误: root@root# python Python 2.7.3 (default, Jul 7 2014, 18:10:53) [GCC 4.7.0] on linux2 Type "help", "copyright", "credits" or "license" for more information. import ctypes Traceback (most recent call last): File "stdi

导入ctype python模块时,我遇到以下错误:

root@root# python

Python 2.7.3 (default, Jul  7 2014, 18:10:53) 
[GCC 4.7.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.

import ctypes

Traceback (most recent call last):

  File "stdin", line 1, in "module"

  File "/usr/lib32/python2.7/ctypes/__init__.py", line 555, in "module"

    _reset_cache()
  File "/usr/lib32/python2.7/ctypes/__init__.py", line 279, in _reset_cache

    CFUNCTYPE(c_int)(lambda: None)
RuntimeError: ffi_prep_closure failed with 2
>>> 
如果需要更多信息,请告诉我


谢谢

这是因为pyton使用的FFI来自libffi

通过以下路径,问题被重新解决:


x86\u 64平台上没有问题,但在ppc p2020ds和octeon 2平台上可以看到这个问题。似乎ffi\u prep\u closure\u loc()返回ffi\u BAD\u ABI(值2)。所以这是一些工具链问题??与此相同,在ppc p2020ds和octeon 2平台上观察到精细x86_64和问题。