python
import
ai_generated
true
ModuleNotFoundError: No module named 'numpy'
ID: python/modulenotfounderror-no-module-named
97%Fix Rate
98%Confidence
50Evidence
2023-01-01First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 310 | active | — | — | — |
Root Cause
Python cannot find the specified module — not installed, wrong environment, or wrong Python version.
genericWorkarounds
-
97% success Install in the correct virtual environment: pip install numpy (with venv activated)
Verify with: which python && pip list | grep numpy
-
93% success Ensure you're using the right Python: python -m pip install numpy
python -m pip ensures pip matches the Python interpreter
Dead Ends
Common approaches that don't work:
-
Installing globally with sudo pip install
75% fail
Installs in system Python which may be different from your project's Python
-
Adding the module to sys.path manually
70% fail
Fragile; path changes break the import
Error Chain
Frequently confused with: