tags:

views:

271

answers:

1

As stated in the Storm documentation, I am doing the following to import the necessary symbols for using Storm:

from storm.locals import *

I'm using it alongside with Pylons, and storm is indeed installed as an egg in the virtual Python environment which Pylon setup for me, and it also searches the correct paths.

However, when the import code above is evaluated, the following exception is being thrown:

ImportError: No module named local

But I'm not explicitly including anything from a module named 'local', but 'locals'.

Update (traceback)

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
+1  A: 

Here's the code that's failing.

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

You claim your snippet is

from storm.locals import *

But the error traceback says

from storm.local import *

I'm betting the traceback is right and the file

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

has the incorrect code from storm.local import *. Not the code you wish that it had.

S.Lott
I know what went wrong - I didn't intend on importing the Storm symbols in my controller, but somewhere in my model. I had>from storm.local import * in my controller, while I had >from storm.locals import * in my model file :-( Shame on me. And thanks for opening my eyes.
Anders
My advice is always "read the actual text of the traceback without assuming anything". Sometimes it helps.
S.Lott