ModuleNotFoundError: No module named ‘passlib’, even after pip installing and pipenv installing

  flask, passlib, pipenv, pipenv-install, python

So I know, it seems this question has been asked before, but I do believe I have a unique situation.

I’m developing a Flask app (specifics below). I’ve created a virtual environment with pipenv.
But no matter what I try, I keep getting this error:

ModuleNotFoundError: No module named ‘passlib’

I’ve tried:

  • pip install passlib
  • pip3.9 install passlib
  • pipenv install passlib
  • uninstalling passlib, then pipenv install passlib again

And I’m running out of ideas….

Here is some context:

Python version: 3.9.9
pip version: 20.1.1
Flask version: 1.1.2
Werkzeug version: 1.0.1

OS : Windows 10
Editor: VS Code

Part of the code where I get the error message:

from passlib.hash import sha256_crypt

Source: Python Questions