ModuleNotFoundError: No module named 'newspaper'
Fixes the plain missing-module error for newspaper3k. Use when `from newspaper import Article` fails with ModuleNotFoundError naming newspaper. Not for `No module named 'newspaper3k'` (wrong import name) or the Article name import failure.
The library is not installed in the running Python. The PyPI name is newspaper3k but the import is newspaper. Run python -m pip install newspaper3k and from newspaper import Article works.
The error
ModuleNotFoundError: No module named 'newspaper'Fix it
- Install newspaper3k
python -m pip install newspaper3kExpected: Successfully installed newspaper3k-... with its dependencies.
- Confirm
python -c "from newspaper import Article; print('ok')"Expected: prints ok.
When this applies
- any
from newspaper import ...fails namingnewspaper - a fresh env for an article-extraction script
When it does NOT apply
ImportError: No module named 'newspaper3k'means you wroteimport newspaper3k, which is wrongcannot import name 'Article' from 'newspaper'with newspaper installed is the shadowing problem
Compatibility
newspaper3k 0.9.x. Python 3.8+. Note the project is lightly maintained; lxml/nltk dependency friction on new Pythons is common.
Why it happens
The distribution name (newspaper3k) and the import name (newspaper) differ, a legacy of the Python-2 newspaper package. People who pip install newspaper get the dead Python-2 package or nothing, and people who never install get this ModuleNotFoundError.
Edge cases
- Do NOT
pip install newspaper. That is the abandoned Python 2 package. The maintained one isnewspaper3k. - newspaper3k pulls nltk data on first use. If Article building fails later on missing tokenizers, that is a data download step, not this error.
Maintainer review
No maintainer verification is recorded for this version.
This records the version a maintainer checked. It does not assert that the version is the latest upstream release.