python - Mac OS Big Sur 更新导致 django 1.11 的 pip 安装要求出现 cffi 错误
问题描述
Mac OS Big Sur 更新导致 django 1.11 的 pip 安装要求出现 cffi 错误。我该如何解决这个问题?
Running setup.py install for cffi ... error
ERROR: Command errored out with exit status 1:
command: /Users/axil/Documents/project/projectdotcom/projectdotcomenv_v2/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/gp/2f22kt6s75d8tf653xq_5rfh0000gn/T/pip-install-nsm19ufc/cffi_73cb07cbfd52456caf370009aa7e0938/setup.py'"'"'; __file__='"'"'/private/var/folders/gp/2f22kt6s75d8tf653xq_5rfh0000gn/T/pip-install-nsm19ufc/cffi_73cb07cbfd52456caf370009aa7e0938/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/gp/2f22kt6s75d8tf653xq_5rfh0000gn/T/pip-record-y3_9oop2/install-record.txt --single-version-externally-managed --compile --install-headers /Users/axil/Documents/project/projectdotcom/projectdotcomenv_v2/include/site/python3.8/cffi
cwd: /private/var/folders/gp/2f22kt6s75d8tf653xq_5rfh0000gn/T/pip-install-nsm19ufc/cffi_73cb07cbfd52456caf370009aa7e0938/
Complete output (65 lines):
running install
running build
running build_py
creating build
creating build/lib.macosx-10.9-x86_64-3.8
creating build/lib.macosx-10.9-x86_64-3.8/cffi
copying cffi/backend_ctypes.py -> build/lib.macosx-10.9-x86_64-3.8/cffi
copying cffi/error.py -> build/lib.macosx-10.9-x86_64-3.8/cffi
copying cffi/setuptools_ext.py -> build/lib.macosx-10.9-x86_64-3.8/cffi
copying cffi/__init__.py -> build/lib.macosx-10.9-x86_64-3.8/cffi
copying cffi/cffi_opcode.py -> build/lib.macosx-10.9-x86_64-3.8/cffi
copying cffi/vengine_gen.py -> build/lib.macosx-10.9-x86_64-3.8/cffi
copying cffi/model.py -> build/lib.macosx-10.9-x86_64-3.8/cffi
copying cffi/ffiplatform.py -> build/lib.macosx-10.9-x86_64-3.8/cffi
copying cffi/api.py -> build/lib.macosx-10.9-x86_64-3.8/cffi
copying cffi/vengine_cpy.py -> build/lib.macosx-10.9-x86_64-3.8/cffi
copying cffi/commontypes.py -> build/lib.macosx-10.9-x86_64-3.8/cffi
copying cffi/lock.py -> build/lib.macosx-10.9-x86_64-3.8/cffi
copying cffi/recompiler.py -> build/lib.macosx-10.9-x86_64-3.8/cffi
copying cffi/cparser.py -> build/lib.macosx-10.9-x86_64-3.8/cffi
copying cffi/verifier.py -> build/lib.macosx-10.9-x86_64-3.8/cffi
copying cffi/_cffi_include.h -> build/lib.macosx-10.9-x86_64-3.8/cffi
copying cffi/parse_c_type.h -> build/lib.macosx-10.9-x86_64-3.8/cffi
copying cffi/_embedding.h -> build/lib.macosx-10.9-x86_64-3.8/cffi
copying cffi/_cffi_errors.h -> build/lib.macosx-10.9-x86_64-3.8/cffi
running build_ext
building '_cffi_backend' extension
creating build/temp.macosx-10.9-x86_64-3.8
creating build/temp.macosx-10.9-x86_64-3.8/c
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -DUSE__THREAD -DHAVE_SYNC_SYNCHRONIZE -I/usr/local/Cellar/libffi/3.3/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/ffi -I/Users/axil/Documents/project/projectdotcom/projectdotcomenv_v2/include -I/Library/Frameworks/Python.framework/Versions/3.8/include/python3.8 -c c/_cffi_backend.c -o build/temp.macosx-10.9-x86_64-3.8/c/_cffi_backend.o
c/_cffi_backend.c:4197:31: warning: assigning to 'char *' from 'const char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
*p_printable_filename = PyText_AsUTF8(s);
^ ~~~~~~~~~~~~~~~~
c/_cffi_backend.c:5911: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))
^
In file included from c/_cffi_backend.c:7370:
In file included from c/cffi1_module.c:20:
c/call_python.c:20:30: error: incomplete definition of type 'struct _is'
builtins = tstate->interp->builtins;
~~~~~~~~~~~~~~^
/Library/Frameworks/Python.framework/Versions/3.8/include/python3.8/pystate.h:20:8: note: forward declaration of 'struct _is'
struct _is;
^
In file included from c/_cffi_backend.c:7370:
In file included from c/cffi1_module.c:20:
c/call_python.c:160:39: error: incomplete definition of type 'struct _is'
new1 = PyThreadState_GET()->interp->modules;
~~~~~~~~~~~~~~~~~~~~~~~~~~~^
/Library/Frameworks/Python.framework/Versions/3.8/include/python3.8/pystate.h:20:8: note: forward declaration of 'struct _is'
struct _is;
^
In file included from c/_cffi_backend.c:7370:
In file included from c/cffi1_module.c:20:
c/call_python.c:249:63: error: incomplete definition of type 'struct _is'
if (externpy->reserved1 != PyThreadState_GET()->interp->modules) {
~~~~~~~~~~~~~~~~~~~~~~~~~~~^
/Library/Frameworks/Python.framework/Versions/3.8/include/python3.8/pystate.h:20:8: note: forward declaration of 'struct _is'
struct _is;
^
2 warnings and 3 errors generated.
error: command 'gcc' failed with exit status 1
解决方案
我有相似性问题。也许,你的python版本太高了,你可以把你的python版本改成3.6,就可以了。
推荐阅读
- algorithm - 找到具有最多 1 的 nXn 子矩阵
- extjs - 如何在 ExtJs 网格中实现插件
- c# - 在以下情况下删除不需要的尾随逗号的正确和安全方法是什么?
- javascript - 多维数组中的 Javascript 表
- ruby-on-rails - ffmpeg 视频分割少于 10 秒会产生黑色剪辑 - ubuntu 18.04 LTS
- typescript - Typescipt 泛型 - 返回具有相同类型泛型参数的新实例
- r - 如何消除高度相关的特征?
- .net - 最新的稳定、不稳定和预发布包之间有什么区别
- c++ - Runtime 如何在运行时推断类型?
- javascript - Spring Framework:接收 POST 请求时如何接受对象数组作为数据参数之一?