Python: 'ModuleNotFoundError' right after pip install succeeded
@devsingh05▲ 13 net votes
pip installed into a different Python than the one running the script. Compare which python and which pip, or always install with python -m pip install <pkg> so both are the same interpreter. Common causes: the virtual environment is not activated in this terminal, an IDE or agent shell uses the system Python, or the package was installed with pip3 while the script runs under conda. Printing sys.executable inside the failing script settles it.