在macosm1体系结构上安装python typedb客户端时出现问题



当我尝试使用pip安装python typedb客户端时,我收到了几个关于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

以及许多行:

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

这种情况在全局安装和conda环境中都会发生。。。

在M1架构上搜索grpcio安装问题后,我的解决方案是在pip命令中准备以下内容:


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

在某些情况下,如果您看到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

假设您通过自制软件安装了openssl。这个命令告诉pip在哪里查找合适的头和代码来构建grpcio pip包。

最新更新