pip 安裝 grpcio 報錯

ponponon發表於2022-02-12

問題描述:

平臺:ARM macbook

pip 安裝 grpcio 報錯

          raise CompileError(msg)
      distutils.errors.CompileError: command '/usr/bin/clang' failed with exit code 1
      
      [end of output]
  
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> grpcio

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.

解決辦法:

加四對環境變數

CFLAGS="-I/opt/homebrew/opt/openssl/include" LDFLAGS="-L/opt/homebrew/opt/openssl/lib" GRPC_PYTHON_BUILD_SYSTEM_OPENSSL=1 GRPC_PYTHON_BUILD_SYSTEM_ZLIB=1 pip install grpcio==1.37    

參考文章:
grpcio fails to install on Apple Silicon #25082

相關文章