Python
ModuleNotFoundError: No module named 'xxx'
ModuleNotFoundError
Python cannot find the requested module. Usually caused by wrong environment, missing install, or incorrect import path.
Common Causes
- Package not installed (pip install missing)
- Using wrong Python interpreter (system vs venv)
- Import path doesn't match package structure
- PYTHONPATH not set correctly
Fixes
- 1. Install the package
pip install xxx
- 2. Use a virtual environment
python -m venv .venv source .venv/bin/activate # or .venv\Scripts\activate on Windows pip install -r requirements.txt
- 3. Install in editable mode for local packages
pip install -e .
Still not fixed?
- • Search the exact error message on Stack Overflow or GitHub Issues
- • Check the official docs for the language or tool
- • Ensure your versions (Node, Python, npm, Docker) are up to date
- • Try in a minimal reproduction (new project, single file)
Related Errors
DuskTools That Might Help
All Errors
JavaScript Heap Out of MemoryAddress Already in UseIndentationErrorCannot Find ModulePeer Dependency WarningCORS Policy BlockedTypeError: 'NoneType' Not SubscriptableMerge ConflictDocker Port Already AllocatedENOENT: No Such File or DirectoryKeyErrorMaxListenersExceededWarningRecursionErrorDetached HEAD StateEACCES: Permission DeniedValueErrorNo Space Left on DeviceERR_REQUIRE_ESMFileNotFoundError