0

我正在尝试在 virtualenv 中设置一个 Web.py (0.37) 项目以在 Google App Engine (1.7.2) 上运行,但我ImportError: No module named web从 appserver 获得了一个。

我已经从我的 virtualenv 中安装了 web.py python setup.py install,并且可以确认它已正确安装,因为我可以从 python 解释器中导入它。

我实际的 GAE 文件夹在 virtualenv 之外,但链接如下:

ln -s ~/Development/google_appengine $VIRTUAL_ENV/google_appengine

并添加到我的python路径中$VIRTUAL_ENV/lib/python2.7/site-packages/gae.pth

我必须缺少一个额外的步骤,这是错误消息:

    ERROR    2012-10-03 09:03:17,442 wsgi.py:203] 
Traceback (most recent call last):
  File "/home/sett/Development/google_appengine/google/appengine/runtime/wsgi.py", line 195, in Handle
    handler = _config_handle.add_wsgi_middleware(self._LoadHandler())
  File "/home/sett/Development/google_appengine/google/appengine/runtime/wsgi.py", line 239, in _LoadHandler
    handler = __import__(path[0])
  File "/home/sett/Development/google_appengine/google/appengine/tools/dev_appserver_import_hook.py", line 719, in Decorate
    return func(self, *args, **kwargs)
  File "/home/sett/Development/google_appengine/google/appengine/tools/dev_appserver_import_hook.py", line 1923, in load_module
    return self.FindAndLoadModule(submodule, fullname, search_path)
  File "/home/sett/Development/google_appengine/google/appengine/tools/dev_appserver_import_hook.py", line 719, in Decorate
    return func(self, *args, **kwargs)
  File "/home/sett/Development/google_appengine/google/appengine/tools/dev_appserver_import_hook.py", line 1787, in FindAndLoadModule
    description)
  File "/home/sett/Development/google_appengine/google/appengine/tools/dev_appserver_import_hook.py", line 719, in Decorate
    return func(self, *args, **kwargs)
  File "/home/sett/Development/google_appengine/google/appengine/tools/dev_appserver_import_hook.py", line 1730, in LoadModuleRestricted
    description)
  File "/home/sett/wip/rigmarolesoup/main.py", line 1, in <module>
    import web
ImportError: No module named web
4

1 回答 1

2

应用引擎不允许您从站点包中导入第 3 方模块;您必须将 web.py 复制到您的应用程序目录中。

于 2012-10-04T04:15:11.637 回答