GAE/P3 dependency conflicts

I have a GAE standard Python 3 app. When I deploy with

gcloud app deploy app.yaml --project XXX

and this for my requirements.txt:

Werkzeug==1.0.1
Flask==1.1.2
Flask-Login==0.5.0
Flask-WTF==0.14.3
google-cloud-ndb==1.10.5
google-cloud-tasks==2.6.0
firebase-admin==5.0.3

I now get this error:

Updating service [default]...
WARNING: Found incompatible dependencies: 
google-cloud-datastore 1.15.3 has requirement google-api-core[grpc]<2.0.0dev,>=1.14.0, but you have google-api-core 2.1.1.
google-cloud-core 1.7.2 has requirement google-api-core<2.0.0dev,>=1.21.0, but you have google-api-core 2.1.1.
google-cloud-core 1.7.2 has requirement google-auth<2.0dev,>=1.24.0, but you have google-auth 2.3.0.

Although my app appears to be working, I'd like to get rid of these errors just in case.

I don't get these errors on my Mac, and nothing requires google-api-core 2.1.1.

The output of pipdeptree | fgrep api-core is:

  - google-api-core [required: >=1.22.1,<3.0.0dev, installed: 1.31.3]
    - google-api-core [required: >=1.21.0,<3.0.0dev, installed: 1.31.3]
    - google-api-core [required: >=1.26.0,<3.0.0dev, installed: 1.31.3]
      - google-api-core [required: >=1.21.0,<2.0.0dev, installed: 1.31.3]
    - google-api-core [required: >=1.29.0,<3.0dev, installed: 1.31.3]
      - google-api-core [required: >=1.21.0,<2.0.0dev, installed: 1.31.3]
    - google-api-core [required: >=1.14.0,<2.0.0dev, installed: 1.31.3]
      - google-api-core [required: >=1.21.0,<2.0.0dev, installed: 1.31.3]
  - google-api-core [required: >=1.26.0,<3.0.0dev, installed: 1.31.3]

My requirements.txt is shown below.

Is there a combination of versions of google-cloud-ndb, google-cloud-tasks, and firebase-admin that work together?

1 answer

  • answered 2021-10-25 03:10 Mabel A.

    When version numbers are not explicitly set in requirements.txt, the system will install the most recent version. And sometimes, the most recent version of one package is not compatible to another package.

    In your project, google-api-core 2.1.1 is automatically installed but your version of google-cloud-datastore needs something lower than 2.0.0 but a minimum of 1.14.0. The same logic goes with the warnings related to google-cloud-core 1.7.2.

    To fix this, you should explicitly set the version numbers for the mentioned packages using the version range provided in the warning message. You'll have to pick something that works for you. For example, you can have google-api-core 1.14.0 in your requirements.txt file but this assumes that there is nothing in your code that needs a feature that is in a higher release.

How many English words
do you know?
Test your English vocabulary size, and measure
how many words do you know
Online Test
Powered by Examplum