1

When I try to install the python typedb-client using pip, I get several errors concerning 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...

hkuich
  • 129
  • 1
  • 8

1 Answers1

1

After searching for grpcio installation issues on the M1 architecture, the solution for me was to prepend the following to the pip command:


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:

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. This tells pip where to look for appropriate headers and code to build the grpcio pip package.

hkuich
  • 129
  • 1
  • 8
  • When thereafter using the typedb-client library in your python code, you might have to create symlinks as well. To do so, run the following (adjust homebrew paths accordingly): ```ln -s /opt/homebrew/opt/openssl/lib/libcrypto.1.1.dylib /usr/local/lib/``` and ```ln -s /opt/homebrew/opt/openssl/lib/libssl.1.1.dylib /usr/local/lib/``` – hkuich Aug 27 '22 at 05:40