ImportError: No module named 'readability'
Fixes the missing-module error for readability-lxml. Use when `from readability import Document` fails with `No module named 'readability'`. Not for the wrong-package or shadowing variants (those import the module fine).
Neither readability package is installed. Run python -m pip install readability-lxml (the real article extractor). Make sure you do NOT install the unrelated bare readability package, or you will trade this error for the cannot import name 'Document' one.
The error
ImportError: No module named 'readability'Fix it
- Install readability-lxml
python -m pip install readability-lxmlExpected: Successfully installed readability-lxml-....
- Confirm
python -c "from readability import Document; print('ok')"Expected: prints ok.
When this applies
- the error is
No module named 'readability'(nothing installed) - a fresh env for an article-extraction script
When it does NOT apply
cannot import name 'Document' from 'readability'means the WRONG package is installedpartially initialized modulemeans your own file shadows it
Compatibility
readability-lxml 0.8.x. (On Python 2 this printed as ImportError; on Python 3.6+ the same situation usually prints ModuleNotFoundError. Both wordings mean the same missing install.)
Why it happens
The package was never installed into the active interpreter. The extra trap here is installing the wrong PyPI name afterward, so the fix spells out readability-lxml explicitly.
Edge cases
- readability-lxml needs lxml. If the install succeeds but the import then fails on lxml, fix lxml separately.
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.