Cliff Ribeiro
Cliff Ribeiro

Reputation: 75

Python Error: ModuleNotFoundError: No module named 'dotenv'

tried reinstalling, uninstalling same thing. Windows 10, python 3.9. Any suggestions? Tried now again and it gave me a returned non-zero exit status 1.

Upvotes: 4

Views: 15109

Answers (3)

Jaden Taylor
Jaden Taylor

Reputation: 13

pip install python-dotenv. If still getting the 'ModuleNotFoundError', it could be that python is trying to access it in the wrong directory.

There are ways to go around this which you can find in this video (talks about pandas, but still same jist) https://www.youtube.com/watch?v=QVZQCvRB9v0&list=PLt07sZ5fS9b5WlkbsOCwzKFQyoPthz69X&index=1, but honestly uninstalling and reinstalling python usually fixes things (you'll have to resetup any virtual environments though).

Upvotes: 1

flyingfishcattle
flyingfishcattle

Reputation: 2153

Running python -m pip install python-dotenv solved it for me.

Upvotes: 2

scob_
scob_

Reputation: 287

You're trying to install the wrong package.

It's pip install python-dotenv.

See https://pypi.org/project/python-dotenv/

Upvotes: 5

Related Questions