首页 > 解决方案 > 错误:Apple Arm64 ABI 需要 ffi_prep_cif_var

问题描述

我已将我的 Intel mac 更新为 Big Sur v11.0.1,并且对我的一个工作项目的依赖失败。我不使用 python,所以不确定如何处理这个错误。我所有其他 pip 安装都没有问题。

因此,当我运行时pip3 install pyOpenSSL,它会因错误而失败Using cached cryptography-3.2.1.tar.gz

ERROR: Command errored out with exit status 1:
   command: /<my-project>/venv/bin/python3 /<my-project>/venv/lib/python3.8/site-packages/pip install --ignore-installed --no-user --prefix /private/var/folders/gg/djb6q6054pxf6rzpjg516k9c0000gn/T/pip-build-env-bj2qm41h/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'setuptools>=40.6.0' wheel 'cffi>=1.8,!=1.11.3; platform_python_implementation != '"'"'PyPy'"'"''
#error Apple Arm64 ABI requires ffi_prep_cif_var
       ^
c/_cffi_backend.c:6304:9: warning: 'ffi_prep_closure' is deprecated [-Wdeprecated-declarations]
  if (ffi_prep_closure(closure, &cif_descr->cif,
              ^
/usr/local/Cellar/libffi/3.3/include/ffi.h:341:18: note: 'ffi_prep_closure' has been explicitly marked deprecated here
        __attribute__((deprecated))
                       ^
1 warning and 1 error generated.
error: command 'clang' failed with exit status 1

我在 repos 中看到了一些问题,例如 this issue和 this issue,但由于我经常不使用 python 或 pip,我不确定根错误是什么或如何修复。

任何建议或见解将不胜感激。

标签: pythonpippyopensslpython-cryptography

解决方案


为了解除这个错误,我使用官方文档3.9中的步骤安装了 python 。然后在我的项目中运行命令。

# delete my venv folder first
python3.9 -m venv venv
pip install -r requirements.txt

所有要求(包括 pyOpenSSL)现在都按预期安装和工作。

我仍然无法在 python 中使用它3.8,所以升级到3.9.


推荐阅读