You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ImportError: cannot import name 'connection' in logs when deploying via App Engine #689
Error when deploying to App Engine: from google.cloud.pubsub.connection import Connection File "/env/lib/python3.4/site-packages/google/cloud/pubsub/connection.py", line 19, in <module> from google.cloud import connection as base_connection ImportError: cannot import name 'connection'
In the CLI I eventually get the below error and the app simply is repeatedly relaunching.
ERROR: (gcloud.app.deploy) Error Response: [13] Timed out when starting VMs. It's possible that the application code is unhealthy.
Traceback (most recent call last): File "main.py", line 22, in <module> from google.cloud import pubsub File "C:\Users\keenj\AppData\Local\Programs\Python\Python35-32\lib\site-packages\google\cloud\pubsub\__init__.py", line 27, in <module> from google.cloud.pubsub.client import Client File "C:\Users\keenj\AppData\Local\Programs\Python\Python35-32\lib\site-packages\google\cloud\pubsub\client.py", line 21, in <module> from google.cloud.pubsub.connection import Connection File "C:\Users\keenj\AppData\Local\Programs\Python\Python35-32\lib\site-packages\google\cloud\pubsub\connection.py", line 19, in <module> from google.cloud import connection as base_connection ImportError: cannot import name 'connection'
Tried again with a new clone and virtualenv locally. This worked. Now for deploying in App Engine... I was getting errors from Cloud Compute re: alpha not enabled. I will try to reproduce. Changed zones and now it works.
Activity
theacodes commentedon Nov 29, 2016
Hi @jkeenest does this work locally? Can you share the entire stacktrace/deploy output?
jeremykeen commentedon Nov 30, 2016
locally run..
Traceback (most recent call last): File "main.py", line 22, in <module> from google.cloud import pubsub File "C:\Users\keenj\AppData\Local\Programs\Python\Python35-32\lib\site-packages\google\cloud\pubsub\__init__.py", line 27, in <module> from google.cloud.pubsub.client import Client File "C:\Users\keenj\AppData\Local\Programs\Python\Python35-32\lib\site-packages\google\cloud\pubsub\client.py", line 21, in <module> from google.cloud.pubsub.connection import Connection File "C:\Users\keenj\AppData\Local\Programs\Python\Python35-32\lib\site-packages\google\cloud\pubsub\connection.py", line 19, in <module> from google.cloud import connection as base_connection ImportError: cannot import name 'connection'theacodes commentedon Nov 30, 2016
Hi Jeremy, it seems you might have an old/broken install of the google cloud libraries. Can you send over the output of
pip freeze?You should use a virtualenv when working locally, this will ensure the sample has the correct version of the dependencies.
jeremykeen commentedon Dec 2, 2016
Tried again with a new clone and virtualenv locally. This worked. Now for deploying in App Engine... I was getting errors from Cloud Compute re: alpha not enabled. I will try to reproduce. Changed zones and now it works.
theacodes commentedon Dec 2, 2016
Great, I'm gonna close this issue but feel free to reach out if you need anything else.
chore(deps): update dependency google-cloud-bigquery to v3.4.1 (#689)
chore(deps): update dependency google-cloud-bigquery to v3.4.1 (#689)
feat: remove python 3.6 support (#689)