简体   繁体   English

在 macOS m1 架构上安装 python typedb-client 时出现问题

[英]Issues installing python typedb-client on macOs m1 architecture

When I try to install the python typedb-client using pip, I get several errors concerning grpcio:当我尝试使用 pip 安装 python typedb-client 时,我收到几个有关 grpcio 的错误:

Building wheels for collected packages: grpcio
  Building wheel for grpcio (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [21870 lines of output]
      ASM Builds for BoringSSL currently not supported on: macosx-11.1-arm64

as well as many lines of:以及许多行:

...
distutils.errors.CompileError: command '/usr/bin/gcc' failed with exit code 1
...

This happens both on global installation and in conda environments...这发生在全局安装和 conda 环境中......

After searching for grpcio installation issues on the M1 architecture, the solution for me was to prepend the following to the pip command:在 M1 架构上搜索 grpcio 安装问题后,我的解决方案是在 pip 命令之前添加以下内容:


export GRPC_PYTHON_BUILD_SYSTEM_OPENSSL=1 export GRPC_PYTHON_BUILD_SYSTEM_ZLIB=1 pip install typedb-client==2.9.0

in some cases, should you see ssl errors, you can extend that command to:在某些情况下,如果您看到 ssl 错误,您可以将该命令扩展为:

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 typedb-client==2.9.0

assuming that you have openssl install via homebrew.假设您通过自制软件安装了 openssl。 This tells pip where to look for appropriate headers and code to build the grpcio pip package.这告诉 pip 在哪里寻找合适的头文件和代码来构建 grpcio pip package。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM