Discussion Forum

Installing Python Client Fails on grpcio 1.38.0

I’m trying to install typedb-client for python. I’m running python 3.10 and the latest version of pip. Here is the output from an attempted pip install. The typedb protocol was successfully installed, but the installation errored on grpcio.

[Note: there is a prior Topic: “Dependency on grpcio 1.24.1” with a similar problem. That problem was resolved by upgrading the grpcio version.]

PS C:\Users\mikei\AppData\Local\Programs\Python\Python310> py -3 -m pip install typedb-client
Collecting typedb-client
Downloading typedb-client-2.5.0.tar.gz (41 kB)
|████████████████████████████████| 41 kB 3.2 MB/s
Preparing metadata (setup.py) … done
Collecting typedb-protocol==2.5.0
Downloading typedb-protocol-2.5.0.tar.gz (45 kB)
|████████████████████████████████| 45 kB …
Preparing metadata (setup.py) … done
Collecting grpcio==1.38.0
Downloading grpcio-1.38.0.tar.gz (21.4 MB)
|████████████████████████████████| 21.4 MB 6.8 MB/s
Preparing metadata (setup.py) … done
Collecting protobuf==3.15.5
Downloading protobuf-3.15.5-py2.py3-none-any.whl (173 kB)
|████████████████████████████████| 173 kB …
Collecting six>=1.5.2
Downloading six-1.16.0-py2.py3-none-any.whl (11 kB)
Using legacy ‘setup.py install’ for typedb-client, since package ‘wheel’ is not installed.
Using legacy ‘setup.py install’ for grpcio, since package ‘wheel’ is not installed.
Using legacy ‘setup.py install’ for typedb-protocol, since package ‘wheel’ is not installed.
Installing collected packages: six, typedb-protocol, protobuf, grpcio, typedb-client
Running setup.py install for typedb-protocol … done
Running setup.py install for grpcio … error
ERROR: Command errored out with exit status 1:
command: ‘C:\Users\mikei\AppData\Local\Programs\Python\Python310\python.exe’ -u -c ‘import io, os, sys, setuptools, tokenize; sys.argv[0] = ‘"’"‘C:\Users\mikei\AppData\Local\Temp\pip-install-zefbgfgn\grpcio_180239054d9b4e75999a24ad6be094cd\setup.py’"’"’; file=’"’"‘C:\Users\mikei\AppData\Local\Temp\pip-install-zefbgfgn\grpcio_180239054d9b4e75999a24ad6be094cd\setup.py’"’"’;f = getattr(tokenize, ‘"’"‘open’"’"’, open)(file) if os.path.exists(file) else io.StringIO(’"’"‘from setuptools import setup; setup()’"’"’);code = f.read().replace(’"’"’\r\n’"’"’, ‘"’"’\n’"’"’);f.close();exec(compile(code, file, ‘"’"‘exec’"’"’))’ install --record ‘C:\Users\mikei\AppData\Local\Temp\pip-record-bzxntgjo\install-record.txt’ --single-version-externally-managed --compile --install-headers ‘C:\Users\mikei\AppData\Local\Programs\Python\Python310\Include\grpcio’
cwd: C:\Users\mikei\AppData\Local\Temp\pip-install-zefbgfgn\grpcio_180239054d9b4e75999a24ad6be094cd
Complete output (171 lines):

Hi @MikeM,

Thank you for reporting! Could you please post the complete log of the error (preferably as a text file)? It looks like the one you’ve pasted isn’t complete.

Here’s the complete error log.
python client error printout.txt (17.8 KB)

@MikeM

It looks like this is the most relevant bit highlighting the issue:

    distutils.errors.DistutilsPlatformError: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/

Could you try obtaining said tool (C++ compiler & build tools from Microsoft) and try again?

Max:
I saw the same line a couple of days ago. I downloaded and installed “Microsoft Visual C++ 2015-2022 redistributable (x86)”. However, after installation, the problem continued. I thought that these VC++ redistributables are supposed to serve the same purpose as the full compiler and build tool package. But not in this case.

Today I downloaded the full Visual Studio package, which did work - up to a point. The grpcio installation started but errored on:
Traceback (most recent call last):
File “C:\Users\mikei\AppData\Local\Programs\Python\Python310\lib\distutils_msvccompiler.py”, line 401, in compile
self.spawn(args)
File “C:\Users\mikei\AppData\Local\Programs\Python\Python310\lib\distutils_msvccompiler.py”, line 507, in spawn
return super().spawn(cmd)
File “C:\Users\mikei\AppData\Local\Temp\pip-install-w1mq31gn\grpcio_8db5bf47c244407cb46fdeb8c45a8347\src\python\grpcio_spawn_patch.py”, line 54, in _commandfile_spawn
_classic_spawn(self, command)
File “C:\Users\mikei\AppData\Local\Programs\Python\Python310\lib\distutils\ccompiler.py”, line 910, in spawn
spawn(cmd, dry_run=self.dry_run)
File “C:\Users\mikei\AppData\Local\Programs\Python\Python310\lib\distutils\spawn.py”, line 91, in spawn
raise DistutilsExecError(
distutils.errors.DistutilsExecError: command ‘C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\bin\HostX86\x64\cl.exe’ failed with exit code 1

I’ve attached the full error output.

python client installation error output.txt (536.8 KB)