Running this code:
import feedparser
Feed = feedparser.parse('http://www.reddit.com/r/python/.rss')
pointer = Feed.entries[1]
print (pointer.summary)
print (pointer.link)
I get this error:
AttributeError: partially initialized module 'feedparser' has no attribute '__version__' (most likely due to a circular import)
I'm using Idle on a Mac, but I get the same error running in Terminal.
I cannot reproduce your symptom.
Using feedparser 6.0.10 under cPython 3.10.8 and macos 12.6.2 your 1st print says:
and your 2nd print says
Use
$ python -m siteto verify thatsys.pathpoints to where you think it should, and that you've installed just a single feedparser library there. Consider nuking your venv and doing pip installs from scratch.It is possible that you showed us just an excerpt from a larger codebase. Read your posted question and try to reproduce the symptom -- copy-n-paste those few lines of code into a new file and run that. Or use example code from the docs, which is very similar. It sounds like your install can't even support
$ python -c 'import feedparser'yet.