Module import error using IDLE

Posted by Nimbuz on Stack Overflow See other posts from Stack Overflow or by Nimbuz
Published on 2009-11-21T03:55:49Z Indexed on 2010/05/18 5:41 UTC
Read the original article Hit count: 432

Filed under:
|
|

I'm an absolute beginner using IDLE (Python 2.6.4) to learn the basics. I recently found a Python program that I want to run but it throws an error although the code looks fine (i.e all modules exist):

from css.parse import parse

data = """
    em {
    padding: 2px; 
    margin: 1em;
    border-width: medium;
    border-style: dashed;
    line-height: 2.4em;
    }
    p { color: red; font-size: 12pt }
    p:first-letter { color: green; font-size: 200% }
    p:first-line { color: blue }"""

for rule in parse(data):
    print rule

for decl in parse(data)[0]:
    print decl

Error:

ImportError: No module named parse

How do I fix this? I'm using Snow Leopard.

Edit: I guess its a PATH issue, where should I place the modules, which directory?

© Stack Overflow or respective owner

Related posts about python

Related posts about idle-ide