App Engine Python 2.7 - ImportError: cannot import name apiproxy
Asked Answered
S

3

9

With the upgrade to Google Cloud SDK 360.0.0-0 i started seeing the following error when running the dev_appserver.py command for my Python 2.7 App Engine project.

  File "/home/..................py", line 6, in <module>
    from google.appengine.ext import ndb
  File "/usr/lib/google-cloud-sdk/platform/google_appengine/python27/sdk/google/appengine/ext/ndb/__init__.py", line 22, in <module>
    from tasklets import *
  File "/usr/lib/google-cloud-sdk/platform/google_appengine/python27/sdk/google/appengine/ext/ndb/tasklets.py", line 85, in <module>
    from .google_imports import apiproxy_stub_map
  File "/usr/lib/google-cloud-sdk/platform/google_appengine/python27/sdk/google/appengine/ext/ndb/google_imports.py", line 44, in <module>
    from google.appengine.runtime import apiproxy as callback
ImportError: cannot import name apiproxy

gcloud version

Google Cloud SDK 360.0.0
alpha 2021.10.04
app-engine-python 1.9.95
app-engine-python-extras 1.9.95
beta 2021.10.04
bq 2.0.71
cloud-build-local 0.5.2
cloud-datastore-emulator 2.1.0
core 2021.10.04
gsutil 5.3
Spelaean answered 6/10, 2021 at 12:3 Comment(0)
S
8

EDIT

This issue seems to have been resolved with Google Cloud SDK version 371


On my debian based system i fixed it by downgrading the app-engine-python component to the previous version

sudo apt-get install google-cloud-sdk-app-engine-python=359.0.0-0
sudo apt-get install google-cloud-sdk-app-engine-python-extras=359.0.0-0

gcloud version (after downgrade)

Google Cloud SDK 360.0.0
alpha 2021.10.04
app-engine-python 1.9.94
app-engine-python-extras 1.9.95
beta 2021.10.04
bq 2.0.71
cloud-build-local 0.5.2
cloud-datastore-emulator 2.1.0
core 2021.10.04
gsutil 5.3

I created an issue for this bug: https://issuetracker.google.com/issues/202171426

Spelaean answered 6/10, 2021 at 12:3 Comment(3)
A big problem for Windows users (like me) - there is no analog to apt-get that can help with this.Calysta
Does anyone know if it was fixed, we now have SDK version 362Calysta
@Calysta i tried 362 this morning and it still didn't work. Also it seems that app-engine-python-extras>=361 is incompatible with app-engine-python<361 so one have to downgrade app-engine-python-extras as well if app-engine-python is downgraded.Spelaean
A
3

For windows you can try this

gcloud components update --version 355.0.0
Autosome answered 27/10, 2021 at 21:20 Comment(0)
C
2

Google-cloud-sdk version 364 still hasn't been resolved. Windows or mac users can try this:

gcloud components update --version 359.0.0

(The 359 version also includes 'app-engine-python-extras'=1.9.94. So it works well.)

Crore answered 23/11, 2021 at 3:50 Comment(1)
This is what worked for me: github.com/material-motion/directCorrection

© 2022 - 2024 — McMap. All rights reserved.