Closed aktech closed 3 years ago
It seems the datastore client is broken if imported via ndb:
n /root/.config/gcloud/emulators/datastore gamma_app | Exception in thread django-main-thread: gamma_app | Traceback (most recent call last): gamma_app | File "/usr/local/lib/python3.7/threading.py", line 926, in _bootstrap_inner gamma_app | self.run() gamma_app | File "/usr/local/lib/python3.7/threading.py", line 870, in run gamma_app | self._target(*self._args, **self._kwargs) gamma_app | File "/usr/local/lib/python3.7/site-packages/django/utils/autoreload.py", line 53, in wrapper gamma_app | fn(*args, **kwargs) gamma_app | File "/usr/local/lib/python3.7/site-packages/django/core/management/commands/runserver.py", line 109, in inner_run gamma_app | autoreload.raise_last_exception() gamma_app | File "/usr/local/lib/python3.7/site-packages/django/utils/autoreload.py", line 76, in raise_last_exception gamma_app | raise _exception[1] gamma_app | File "/usr/local/lib/python3.7/site-packages/django/core/management/__init__.py", line 357, in execute gamma_app | autoreload.check_errors(django.setup)() gamma_app | File "/usr/local/lib/python3.7/site-packages/django/utils/autoreload.py", line 53, in wrapper gamma_app | fn(*args, **kwargs) gamma_app | File "/usr/local/lib/python3.7/site-packages/django/__init__.py", line 24, in setup gamma_app | apps.populate(settings.INSTALLED_APPS) gamma_app | File "/usr/local/lib/python3.7/site-packages/django/apps/registry.py", line 114, in populate gamma_app | app_config.import_models() gamma_app | File "/usr/local/lib/python3.7/site-packages/django/apps/config.py", line 211, in import_models gamma_app | self.models_module = import_module(models_module_name) gamma_app | File "/usr/local/lib/python3.7/importlib/__init__.py", line 127, in import_module gamma_app | return _bootstrap._gcd_import(name[level:], package, level) gamma_app | File "<frozen importlib._bootstrap>", line 1006, in _gcd_import gamma_app | File "<frozen importlib._bootstrap>", line 983, in _find_and_load gamma_app | File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked gamma_app | File "<frozen importlib._bootstrap>", line 677, in _load_unlocked gamma_app | File "<frozen importlib._bootstrap_external>", line 728, in exec_module gamma_app | File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed gamma_app | File "/usr/src/app/app/models.py", line 7, in <module> gamma_app | from google.cloud import ndb gamma_app | File "/usr/local/lib/python3.7/site-packages/google/cloud/ndb/__init__.py", line 28, in <module> gamma_app | from google.cloud.ndb.client import Client gamma_app | File "/usr/local/lib/python3.7/site-packages/google/cloud/ndb/client.py", line 26, in <module> gamma_app | from google.cloud.datastore_v1.gapic import datastore_client gamma_app | ModuleNotFoundError: No module named 'google.cloud.datastore_v1.gapic'
Solution is to get completely rid of ndb.
It seems the datastore client is broken if imported via ndb:
Solution is to get completely rid of ndb.