pip install worked. The module is still missing.
This happens because pip and python are two separate commands — they can point to different Python installations. pip installs to one; your script runs on another.
Most common fix — try this first
python -m pip install [package]
python -m pip guarantees the install goes into the same Python that runs your script. If this fixes it, you're done. If not, the diagnostic below finds the exact cause.
2-minute diagnostic
Run two commands, paste the output
This identifies which of the 6 common root causes matches your setup.
Run these in your terminal:
pip --version
python3 --version
pip --version
python --version
Paste the full output of each command exactly as shown in your terminal.
Manual diagnostic checklist
Run each command and compare the outputs:
pip --version— note the Python version in parenthesespython3 --version— compare this Python version to the one abovepip show [package]— note the Location: fieldpython3 -c "import sys; print('\n'.join(sys.path))"— is the Location from above listed here?- If Location is not in sys.path: use
python3 -m pip install [package]to target the correct interpreter - If Location is in sys.path but import still fails: check for a local file named the same as the package in your working directory