ModuleNotFoundError: No module named 'feedparser'
Fixes the plain missing-module error for feedparser. Use when `import feedparser` fails with ModuleNotFoundError naming feedparser. Not for the sgmllib or FeedParserDict import failures (feedparser is installed but broken).
feedparser is not installed in the running Python. Run python -m pip install feedparser to get the current 6.x release, then confirm with python -c "import feedparser". If it still fails, pip installed into a different interpreter than the one running your code.
The error
ModuleNotFoundError: No module named 'feedparser'Fix it
- Install feedparser
python -m pip install feedparserExpected: Successfully installed feedparser-6....
- Confirm
python -c "import feedparser; print(feedparser.__version__)"Expected: prints 6.0.x.
- If it still fails, check the interpreter split
python --version
pip --versionExpected: matching paths. Redo step 1 with python -m pip if they differ.
When this applies
- any feedparser import fails naming
feedparser - a fresh env, container, or CI runner
- an RSS/Atom scraping script moved to a new machine
When it does NOT apply
No module named 'sgmllib'means feedparser 5.x on Python 3 (upgrade)cannot import name 'FeedParserDict'means a stale vendored copy is shadowing
Compatibility
feedparser 6.x current, Python 3.8+. Install the 6.x line; the 5.x line is Python-2-era and broken on Python 3.
Why it happens
The package was never installed into the active environment. RSS scraping scripts are often moved between machines without their requirements, and import feedparser is the first line that notices.
Edge cases
- Do not install the
feedparsersystem package from old distro repos; it may be 5.x. Use pip. - If your code was written against feedparser 5.x APIs, skim the 6.x changelog after installing. Most code works unchanged, but a few edge behaviors moved.