1. 程式人生 > >cffi 安裝報錯“c/_cffi_backend.oc/_cffi_backend.c:15:17: error: ffi.h: No such file or directory”問題

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. 報錯資訊如下:
[[email protected] 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中即可成功找到