vaticle / typedb-driver-python

TypeDB Driver for Python
https://typedb.com
Apache License 2.0
67 stars 25 forks source link

Can not install typedb-client: legacy-install-failure #274

Closed kaad01 closed 1 year ago

kaad01 commented 1 year ago

Please replace every line in curly brackets { like this } with an appropriate description, and remove this line.

Description

I tried to install typedb-client with pip install typedb-client and pip3 install typedb-client

while installing the grpcio library the install fails and gives following output:

note: This error originates from a subprocess, and is likely not a problem with pip.
  Rolling back uninstall of grpcio
  Moving to c:\users\k-t-d\appdata\local\programs\python\python311\lib\site-packages\grpc\
   from C:\Users\K-T-D\AppData\Local\Programs\Python\Python311\Lib\site-packages\~rpc
  Moving to c:\users\k-t-d\appdata\local\programs\python\python311\lib\site-packages\grpcio-1.51.1.dist-info\
   from C:\Users\K-T-D\AppData\Local\Programs\Python\Python311\Lib\site-packages\~rpcio-1.51.1.dist-info
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.

there are also a lot of warnings like:

cl : Befehlszeile warning D9025 : "/MD" wird durch "/MT" \x81berschrieben
cl : Befehlszeile warning D9002 : Unbekannte Option "-std=c++11" wird ignoriert.

This means "unknows Option -std=c++11" gets ignored

Here is the first error I found:

Traceback (most recent call last):
        File "C:\Users\K-T-D\AppData\Local\Programs\Python\Python311\Lib\site-packages\setuptools\_distutils\_msvccompiler.py", line 533, in _fallback_spawn
          yield bag
        File "C:\Users\K-T-D\AppData\Local\Programs\Python\Python311\Lib\site-packages\setuptools\_distutils\_msvccompiler.py", line 521, in spawn
          return super().spawn(cmd, env=env)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
      TypeError: _commandfile_spawn() got an unexpected keyword argument 'env'

      During handling of the above exception, another exception occurred:

Environment

  1. OS (where TypeDB server runs): Windows11
  2. TypeDB version (and platform): TypeDB 2.14.2
  3. TypeDB client-python version: client-python 2.12.1
  4. Python version: 3.11.1
  5. Other environment details: I installed visual studio with the c++ librarys

Reproducible Steps

Steps to create the smallest reproducible scenario: just run pip install typedb-client

Expected Output

Successful installation of typedb-client and the import of the module.

Actual Output

The Error message image It is in German, sorry fo that.

The Import image

kaad01 commented 1 year ago

You are using an old grpcio version. How can I install typedb-client with the newest grpcio version?

alexjpwalker commented 1 year ago

Hi @kaad01 , thank you for reporting this!

On hindsight I think requiring precisely one grpcio version was too strict for typedb-client-python. We should update the package's requirements to allow a flexible version range for grpcio, protobuf.