"pip install x" succeeded; "import x" still fails.
pip installed into a different interpreter/venv than the one running the code.
import sys; print(sys.executable)python -m pip install <pkg>pip show <pkg> | grep LocationAlways python -m pip, never bare pip.
NinjaOps publishes free engineering guides. Some outbound links are affiliate links: they cost you nothing and support the site.
Last reviewed 2026-10-02 · NinjaOps SEO grid · DevOps blog