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.
3 Answers
You're trying to install the wrong package.
It's pip install python-dotenv
.
-
-
Requirement already satisfied: python-dotenv in c:\users\tatiana\appdata\roaming\python\python39\site-packages (0.15.0) Dec 21, 2020 at 23:43
-
from os import environ, path from dotenv import load_dotenv basedir=path.abspath(path.dirname(file)) load_dotenv(path.join(basedir, '.env')) thats my config file. I have a env file in the root directory Dec 21, 2020 at 23:46
-
And it still doesn't work when you try importing it now? That might be an issue with your Python setup then (or a developer bug with 3.9), because I tested on two machines (one running 3.8 and the other running 3.7) and it worked fine. Perhaps it's a bug with their version, they said they've added support for Python 3.9 but it might have a bug.– scob_Dec 21, 2020 at 23:47
-
1took the holiday off. Came back rebuilt everything and now everything works in 3.8. Did I find a bug? Dec 29, 2020 at 8:42
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).
-
While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - From Review May 29 at 0:44
-
pip
or installing the packages yourself?pip install python-dotenv
on both a windows and linux machine and had no problems, but you could try installing it manually.