我正在尝试使用pygit2方法为SaltStack设置gitfs。我在我的机器上安装了pygit2和libgit2:
[root@r9tvap1109 site-packages]# yum list installed | grep git2
libgit2.x86_64 0.21.5-1.el7 @epel
python-pygit2.x86_64 0.21.4-2.el7 @epel
我还安装了python-devel包。这完全适用于Python 2.7。
每当我尝试导入pygit2包以测试它是否正确安装时,我会收到一堆cffi警告和错误。以堆栈跟踪结束:
pygit2/__pycache__/pygit2_cffi_c721781dxbf062fb5.c:6893:21: error: (near initialization for ‘nums[19]’)
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "pygit2/__init__.py", line 35, in <module>
from .blame import Blame, BlameHunk
File "pygit2/blame.py", line 32, in <module>
from .errors import check_error
File "pygit2/errors.py", line 29, in <module>
from .ffi import ffi, C
File "pygit2/ffi.py", line 35, in <module>
ffi, C = get_ffi()
File "pygit2/_utils.py", line 101, in get_ffi
include_dirs=[libgit2_include], library_dirs=[libgit2_lib])
File "cffi/api.py", line 450, in verify
lib = self.verifier.load_library()
File "cffi/verifier.py", line 113, in load_library
self._compile_module()
File "cffi/verifier.py", line 210, in _compile_module
outputfilename = ffiplatform.compile(tmpdir, self.get_extension())
File "cffi/ffiplatform.py", line 29, in compile
outputfilename = _build(tmpdir, ext, compiler_verbose)
File "cffi/ffiplatform.py", line 62, in _build
raise VerificationError('%s: %s' % (e.__class__.__name__, e))
cffi.ffiplatform.VerificationError: CompileError: command 'gcc' failed with exit status 1
以下列出了我尝试过的事情:
感谢任何帮助
答案 0 :(得分:0)
我想出了问题 - 我有一个比包支持的更新版本的python-cffi。我从1.6.0-5降级到0.8.6-2