0

如 Storm 文档中所述,我正在执行以下操作来导入使用 Storm 所需的符号:

from storm.locals import *

我将它与 Pylons 一起使用,storm 确实作为鸡蛋安装在 Pylon 为我设置的虚拟 Python 环境中,它还搜索正确的路径。

但是,当评估上面的导入代码时,会抛出以下异常:

ImportError:没有名为本地的模块

但是我没有明确地包含来自名为“local”的模块中的任何内容,而是“locals”。

更新(回溯)

URL: http://localhost:5000/characters/index
File '/home/andy/pylon-env/lib/python2.6/site-packages/WebError-0.10.1-py2.6.egg/weberror/evalexception.py', line 431 in respond
  app_iter = self.application(environ, detect_start_response)
File '/home/andy/pylon-env/lib/python2.6/site-packages/Beaker-1.3.1-py2.6.egg/beaker/middleware.py', line 70 in __call__
  return self.app(environ, start_response)
File '/home/andy/pylon-env/lib/python2.6/site-packages/Beaker-1.3.1-py2.6.egg/beaker/middleware.py', line 149 in __call__
  return self.wrap_app(environ, session_start_response)
File '/home/andy/pylon-env/lib/python2.6/site-packages/Routes-1.10.3-py2.6.egg/routes/middleware.py', line 130 in __call__
  response = self.app(environ, start_response)
File '/home/andy/pylon-env/lib/python2.6/site-packages/Pylons-0.9.7-py2.6.egg/pylons/wsgiapp.py', line 124 in __call__
  controller = self.resolve(environ, start_response)
File '/home/andy/pylon-env/lib/python2.6/site-packages/Pylons-0.9.7-py2.6.egg/pylons/wsgiapp.py', line 263 in resolve
  return self.find_controller(controller)
File '/home/andy/pylon-env/lib/python2.6/site-packages/Pylons-0.9.7-py2.6.egg/pylons/wsgiapp.py', line 284 in find_controller
  __import__(full_module_name)
File '/home/andy/projects/evecharacters/evecharacters/controllers/characters.py', line 9 in <module>
  from storm.local import *
ImportError: No module named local
4

1 回答 1

1

这是失败的代码。

File '/home/andy/projects/evecharacters/evecharacters/controllers/characters.py', line 9 in <module>
  from storm.local import *
ImportError: No module named local

您声称您的代码段是

from storm.locals import *

但是错误回溯说

from storm.local import *

我打赌回溯是正确的,文件

/home/andy/projects/evecharacters/evecharacters/controllers/characters.py',第 9 行

有不正确的代码from storm.local import *。不是您希望它拥有的代码。

于 2009-07-29T14:08:22.087 回答