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 stoppe开发者_如何学God working, same error.
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.
Issue is with Name of file. Python confuses between name of file and module name.
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论