Feedparser stopped working

3.3k views Asked by At

Yesterday I installed feedparser (on OSX 10.5) and it worked fine, but now it stopped working.

This is the script (copied from feedparser documentation)

import feedparser
d = feedparser.parse('http://feedparser.org/docs/examples/atom10.xml')
d['feed']['title']
u'Sample Feed'

It tells me this:

Traceback (most recent call last):
  File "example.py", line 3, in <module>
    import feedparser
  File "example.py", line 2, in <module>
    d = feedparser.parse('http://feedparser.org/docs/examples/atom10.xml')
AttributeError: 'module' object has no attribute 'parse'

But also an actual script using feedparser stopped working, same error.

2

There are 2 answers

0
Xavier Combelle On BEST ANSWER

The point is when there is a script named feedparser.py, python will considered it as a module to import with higher priority than the module installed.

0
Vishal Mahajan On

Issue is with Name of file. Python confuses between name of file and module name.