从命令行我不能导入appengine,这可能是我的python路径的问题:
$ python
Python 2.7.1+ (r271:86832, Apr 11 2011, 18:13:53)
[GCC 4.5.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from google.appengine.ext import db
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "google/appengine/ext/db/__init__.py", line 98, in <module>
from google.appengine.api import datastore
File "google/appengine/api/datastore.py", line 62, in <module>
from google.appengine.datastore import datastore_query
File "google/appengine/datastore/datastore_query.py", line 64, in <module>
from google.appengine.datastore import datastore_index
File "google/appengine/datastore/datastore_index.py", line 60, in <module>
from google.appengine.api import validation
File "google/appengine/api/validation.py", line 51, in <module>
import yaml
ImportError: No module named yaml
>>> 我不想重复安装,我想把Python解释器指向缺少模块的地方。如何让解释器从命令提示符找到应用引擎模块?在应用程序中,这些导入工作正常。
发布于 2012-01-09 22:38:21
追加:
/usr/local/google_appengine/:/usr/local/google_appengine/lib/:/usr/local/google_appengine/lib/yaml/到您的PYTHONPATH环境变量应该可以做到这一点(您的SDK位置可能会有所不同)。
https://stackoverflow.com/questions/8790038
复制相似问题