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

981 Views Asked by At

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

1

There are 1 best solutions below

0
Alex van Winkel On

Well, thanks to a friend I found a workaround. This workaround might point in the direction of a permanent solution...

So here's the workaround I used:

  • I figured out where pipenv stores the files for the passlib module
  • I copied all the folders related to passlib into my main project folder

PRESTO ! Error message gone...