bulkloader not importing ndb.model

こ雲淡風輕ζ 提交于 2019-12-07 16:02:38

This can also happen if your PYTHONPATH is not properly set up. If you're on Linux, try running this before you run the Bulkloader:

export PYTHONPATH=$PYTHONPATH:.

This appends your current directory to your PYTHONPATH and should make your my_model module visible. Since my memory is terrible and I always forget to do it, I've ended up using a simple shell script that includes this at the beginning and then the bulkload command itself.

If you're on Windows, you should be able to modify your path by using sys.path.append. Haven't tested this, but you could try adding this to your script (note that this should work on Linux as well):

import sys
# ...
sys.path.append('.')

Your code should be located in a file named my_model.py. You are getting that error because there is no module named my_module. Might be worth a read of the Python module and package docs.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!