Why does running "from storm.locals import *" (as per the tutorial) on Centos 5 give "ImportError - No module names locals"?

Asked by Mike Stoddart

Attempting to run:

from storm.locals import *

on Centos 5 gives:

ImportError: No module named locals

Python 2.4.3
python-storm-0.13-2.el5.src.rpm

Any ideas why this is?

Thanks

Question information

Language:
English Edit question
Status:
Answered
For:
Storm Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Launchpad Janitor (janitor) said :
#1

This question was expired because it remained in the 'Open' state without activity for the last 15 days.

Revision history for this message
James Henstridge (jamesh) said :
#2

In the title of the bug, you've written "store.locals" and in the body you've written "storm.locals". Are you sure you typed the correct package name?

If that is the problem, I wonder if it is a problem with the packaging? If you do "rpm -ql python-storm", does it list storm/locals.py along with the other Storm modules?

Revision history for this message
Mike Stoddart (stodge) said :
#3

Oops - sorry, a stupid typo in the title on my part.

RPM shows:

$ rpm -ql python-storm | grep locals
/usr/lib64/python2.4/site-packages/storm/locals.py
/usr/lib64/python2.4/site-packages/storm/locals.pyc
/usr/lib64/python2.4/site-packages/storm/locals.pyo

Which looks to be correct I think.

Thanks

Revision history for this message
Mike Stoddart (stodge) said :
#4

If I do:

$ python -v
>>> from storm.locals import *
# storm.pyc matches storm.py
import storm # precompiled from storm.pyc
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "storm.py", line 5, in ?
    from storm.locals import *
ImportError: No module named locals

I also tried deleting locals.pyo and locals.pyc, but that didn't help.

Revision history for this message
James Henstridge (jamesh) said :
#5

It sounds like you've got some other module shadowing the Storm package. Importing just "storm" should read "storm/__init__.py" rather than "storm.py" as it is a package.

Can you rename the other module to something else?

Can you help with this problem?

Provide an answer of your own, or ask Mike Stoddart for more information if necessary.

To post a message you must log in.