Hey Folks - I am trying to install tensorflow via ...
# ask-community
m
Hey Folks - I am trying to install tensorflow via
poetry add tensorflow
and getting an error relating to incompatible dependencies (
grpcio
) :
Copy code
Because no versions of tensorboard match >2.12,<2.12.1 || >2.12.1,<2.13
 and tensorboard (2.12.0) depends on grpcio (>=1.48.2), tensorboard (>=2.12,<2.12.1 || >2.12.1,<2.13) requires grpcio (>=1.48.2).
    And because tensorboard (2.12.1) depends on grpcio (>=1.48.2), tensorboard (>=2.12,<2.13) requires grpcio (>=1.48.2).
    Because no versions of tensorflow match >2.12.0,<3.0.0
 and tensorflow (2.12.0) depends on tensorboard (>=2.12,<2.13), tensorflow (>=2.12.0,<3.0.0) requires tensorboard (>=2.12,<2.13).
(1) Thus, tensorflow (>=2.12.0,<3.0.0) requires grpcio (>=1.48.2).

    Because no versions of dagster-dbt match >0.17.20,<0.17.21 || >0.17.21,<0.18.0
 and dagster-dbt (0.17.20) depends on dagster (1.1.20), dagster-dbt (>=0.17.20,<0.17.21 || >0.17.21,<0.18.0) requires dagster (1.1.20).
    And because dagster (1.1.20) depends on grpcio (>=1.32.0,<1.48.1), dagster-dbt (>=0.17.20,<0.17.21 || >0.17.21,<0.18.0) requires grpcio (>=1.32.0,<1.48.1).
    And because dagster-dbt (0.17.21) depends on dagster (1.1.21)
 and dagster (1.1.21) depends on grpcio (>=1.32.0,<1.48.1), dagster-dbt (>=0.17.20,<0.18.0) requires grpcio (>=1.32.0,<1.48.1).
    And because tensorflow (>=2.12.0,<3.0.0) requires grpcio (>=1.48.2) (1), tensorflow (>=2.12.0,<3.0.0) is incompatible with dagster-dbt (>=0.17.20,<0.18.0)
    So, because fc-lib depends on both dagster-dbt (^0.17.20) and tensorflow (^2.12.0), version solving failed.
This feels like something I'm not the first to come across - is there a version of tensorflow that folks have been able to install which has the allowable grpcio version range for dagster? I'm struggling to find the requirements on the tensorflow github to see what version has an overlapping pinned range
t
Hi Martin, looks like you are using
poetry
? Here's a little trick I learnt recently. If you run:
Copy code
poetry add "tensorflow@*" --dry-run
It will tell you exactly what the latest compatible version is that can be installed 🙂
e.g. on my machine it appears
dagster-dbt@0.17.20
and
tensorflow@2.3.4
would work together
d
I'm seeing tensorflow 2.9.0 as an option that works if that's not too long ago? Another option is to use python 3.11 which has no grpcio pin currently. We're actively working with the grpc pin to try to get this pin removed, hopefully we'll have more to share on this soon.
m
Thanks @Timo Vink - that works nicely. I get 2.2.0 though which isn't ideal but will get me up and running!
@daniel - so if I use python 3.11 this issue with grpcio should go away? I can try that so - i'll report back ASAP
d
That should work, yeah
m
This is weird. Running:
Copy code
poetry add "tensorflow@*" --dry-run
Shows 2.2.0 as the version I should install (assuming that the following in the logging indicates a potentially successful match):
Copy code
• Installing tensorflow (2.2.0)
However, installing that with poetry gives me all sorts of issues with
h5py
and
scipy
as those packages are incompatible with more recent versions of python at the pins specified by tensorflow 2.2.0 So I tried 2.9.0 based on your comment @daniel and it works fine. Why didn't poetry tell me that!? 😂