[Tutor] module paths

Kent Johnson kent37 at tds.net
Sun Jul 6 16:15:31 CEST 2008


On Sat, Jul 5, 2008 at 6:37 PM, Gonzalo Garcia-Perate
<gonzillaaa at gmail.com> wrote:
> I'm looking at python after a long time. I wanted to build a quick
> parser for some rss feeds and have started using feedparser.
>
> When I test my code on the python interactive shell things work fine
> but when I try to write it into a file I get the following error:
> AttributeError: 'module' object has no attribute 'parse'

It sounds like it is finding the wrong feedparser module. Did you have
a script called feedparser.py? If so rename or delete the .py and .pyc
files. Also you can try
import feedparser
print feedparser.__file__
to see where the module is importing from.

Kent


More information about the Tutor mailing list