【发布时间】:2013-04-02 04:21:35
【问题描述】:
我刚刚在 OS X 上升级到 App Engine Python 开发服务器版本 1.7.6,升级后,我在尝试运行我的应用时收到以下错误:
ERROR 2013-04-02 04:05:14,268 wsgi.py:219]
Traceback (most recent call last):
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/runtime/wsgi.py", line 196, in Handle
handler = _config_handle.add_wsgi_middleware(self._LoadHandler())
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/runtime/wsgi.py", line 255, in _LoadHandler
handler = __import__(path[0])
File "/Users/rmorlok/Dropbox/ryanroot/ryan-projects/Development/docalytics/online/main.py", line 13, in <module>
from google.appengine.tools import dev_appserver
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver.py", line 62, in <module>
import simplejson
ImportError: No module named simplejson
我确保通过运行安装了simplejson
sudo pip install simplejson
成功完成。如果我在控制台上运行 Python 并导入它,我可以成功导入 simplejson,但是当通过 PyCharm 或 GoogleAppengineLaunch 运行我的应用程序时,出现上述错误。
有人知道怎么回事吗?
【问题讨论】:
-
问题似乎来自我正在导入 dev_appserver 本身(来自 google.appengine.tools import dev_appserver)以获取某些实用程序的行。删除该行似乎可以避免该问题。
-
你现在运行的是python 2.7,所以你可以只导入json而不是simplejson,
-
是的,在我的代码中我实际上只是导入了 json。导入simplejson其实在google的开发应用服务器代码中。
-
Pip install 无济于事。您需要将 simplejson 复制到您的项目中。你在 1.7.6 中遇到这个问题很奇怪,它应该会影响到每个人。
-
同样的问题,1.7.7 也没有修复。我不得不退回到 1.7.5 才能让它消失。有什么问题的线索:当我从
dev_appserver.py中删除import simplejson行时,我得到一个单独的ImportError: No module named antlr3由/Applications/GoogleAppEngineLauncher.app/..../appengine/cron/groc.py提出