LoginSignup
1
3

More than 5 years have passed since last update.

GAE/Python3でNDBを使用することはできない(2019年4月現在)

Posted at

概要

The ndb ORM library is not available for Python 3.

以下は補足説明。

NDBとは

App EngineからDatastoreへの接続をサポートするライブラリ。

ORM風味にデータの読み書きができる。

DjangoのMIDDLEWAREに設定を追加するだけで利用可能。

しかしこれはGAE/Python2でしか利用できない。

Python3での動作

SDKを読みに行ってくれず、以下のようなエラーが発生

No module named 'google'
No module named 'google.appengine'

pip installgoogle-api-python-clientgcloud components install app-engine-python-extras などしてもNG。

代わりに何を使えばいいのか

公式

Cloud Datastoreのライブラリを使えばよい。
https://cloud.google.com/datastore/docs/reference/libraries

サードパーティ

NDBをPython3で動かすためのプロジェクト
https://github.com/googleapis/python-ndb

1
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
3