ModuleNotFoundError: No module named 'llvmlite'
Third-person routing text. Fixes numba failing with No module named llvmlite: numba requires the llvmlite package and it is missing. pip install llvmlite (or reinstall numba) fixes it. Use when an agent hits this importing numba. Not for other numba errors.
TL;DR: numba needs the llvmlite package and it is not installed. Run pip install llvmlite (or reinstall numba, which pulls it in) and the import works.
The error
ModuleNotFoundError: No module named 'llvmlite'Fix it
- Install llvmlite:
pip install llvmliteExpected: install completes.
- Verify:
python -c "import numba; print(numba.__version__)"Expected: prints the version, no error.
- If it still fails, reinstall numba so pip resolves the pair together:
pip install --force-reinstall numbaWhen this applies
Use this when import numba raises the llvmlite error, common after a partial install or a botched upgrade.
When it does not apply
If llvmlite is installed but numba still fails, the versions may be mismatched; reinstall both together. If the error names a different module, that is a separate issue.
Compatibility
All numba versions; each numba release requires a specific llvmlite version, so install them as a pair.
Root cause
numba compiles Python to machine code through LLVM, and llvmlite is its LLVM binding layer. It is a hard dependency, but partial installs and --no-deps installs can leave it out.
Edge cases
On conda, install both from conda-forge to keep the LLVM builds consistent. Very new Python versions may need a newer numba/llvmlite pair than your pins allow.