cffi 安装报错“c/_cffi_backend.oc/_cffi_backend.c:15:17: error: ffi.h: No such file or directory”问题

cffi安装问题

环境:powerlinux6.5-64
安装:
1. 解压cffi-1.11.5.tar.gz
2. 进入cffi目录

   cd cffi-1.11.5
   python setup.py install
  1. 报错信息如下:
[root@localhost cffi-1.11.5]# /opt/python-powerlinux6-64/bin/python setup.py install
Package libffi was not found in the pkg-config search path.
Perhaps you should add the directory containing `libffi.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libffi' found
'''
Package libffi was not found in the pkg-config search path.
Perhaps you should add the directory containing `libffi.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libffi' found
Package libffi was not found in the pkg-config search path.
Perhaps you should add the directory containing `libffi.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libffi' found
Package libffi was not found in the pkg-config search path.
Perhaps you should add the directory containing `libffi.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libffi' found
Package libffi was not found in the pkg-config search path.
Perhaps you should add the directory containing `libffi.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libffi' found
running install
running bdist_egg
running egg_info
writing requirements to cffi.egg-info/requires.txt
writing cffi.egg-info/PKG-INFO
writing top-level names to cffi.egg-info/top_level.txt
writing dependency_links to cffi.egg-info/dependency_links.txt
writing entry points to cffi.egg-info/entry_points.txt
reading manifest file 'cffi.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'cffi.egg-info/SOURCES.txt
installing library code to build/bdist.linux-ppc64/egg
running install_lib
running build_py
running build_ext
building '_cffi_backend' extension
gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DUSE__THREAD -DHAVE_SYNC_SYNCHRONIZE -I/usr/include/ffi -I/usr/includ
e/libffi -I/opt/python-powerlinux6-64/include/python2.7 -c c/_cffi_backend.c -o build/temp.linux-ppc64-2.7/c/_cffi_backend.oc/_cffi_backend.c:15:17: error: ffi.h: No such file or directory
In file included from c/_cffi_backend.c:92:
c/malloc_closure.h:81: error: expected specifier-qualifier-list before ‘ffi_closure’
c/malloc_closure.h: In function ‘more_core’:
c/malloc_closure.h:117: warning: division by zero
c/malloc_closure.h:149: error: ‘union mmaped_block’ has no member named ‘next’
c/malloc_closure.h: At top level:

从提示中可以看出:Package libffi was not found in the pkg-config search path.
Perhaps you should add the directory containing `libffi.pc’
to the PKG_CONFIG_PATH environment variable
可以看出是编译时缺少libffi.pc, 找出libffi.pc的的目录,

#### libffi 未安装
安装libffi编译安装即可:

[root@localhost cffi-1.11.5]# export PKG_CONFIG_PATH=/opt/python-powerlinux6-64/lib/pkgconfig/

重新执行:python setup.py install 安装即可成功
在编译python/lib64中即可成功找到

你可能感兴趣的:(python)