簡體   English   中英

cffi 安裝在帶有 pip 的 MacOs 12.5 上失敗

[英]cffi installation got failure on MacOs 12.5 with pip

我正在嘗試在 MacOs 12.5 上使用 pip 安裝“cffi”,但出現錯誤
python:3.8.10
pip:22.2.2
蘋果 clang 版本 13.1.6 (clang-1316.0.21.2.5)

命令:

pip install cffi

錯誤

  /opt/homebrew/bin/gcc-11 -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -I/opt/homebrew/opt/libffi/include -DFFI_BUILDING=1 -DUSE__THREAD -DHAVE_SYNC_SYNCHRONIZE -I/opt/homebrew/Cellar/libffi/3.4.2/include -I/Users/faraz/.pyenv/versions/3.8.10/include/python3.8 -c c/_cffi_backend.c -o build/temp.macosx-12.5-arm64-3.8/c/_cffi_backend.o -iwithsysroot/usr/include/ffi
  gcc-11: error: unrecognized command-line option '-iwithsysroot/usr/include/ffi'
  error: command '/opt/homebrew/bin/gcc-11' failed with exit status 1



  

我還做了以下鏈接中提到的一些提示,但它對我不起作用。 pip cffi package 在 osx 上安裝失敗

閱讀cffi文檔后,我發現"/opt/homebrew/bin/gcc-11"是 gcc,而不是 clang 並且cffi在 Mac 上沒有明確支持 ZE0D511356BD44120AF49CC96C9DCF3BZ。 所以,我將以下行添加到~/.bash_profile並且它有效

# Set Clang as the default compiler for the system 
export CC=clang 
export CFLAGS=-Qunused-arguments 
export CPPFLAGS=-Qunused-arguments 

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM