pip install dotenv error code 1 Windows 10

Question:

I am in a virtualenv and trying to run through pip installs. I know the code works because outside the virtualenv this code has worked. I am running on a Windows 10 machine. Using the Git Bash terminal or the regular command prompt (have tried as admin and regular user).
I am trying to run
pip install dotenv
or
python -m pip install dotenv
and neither of the two work. I get the error saying

AttributeError: module ‘importlib._bootstrap’ has no attribute ‘SourceFileLoader’
During handling of the above exception, another
exception occurred:Command “python setup.py egg_info” failed with
error code 1 in
C:UsersUSER~1AppDataLocalTemppip-build-7bbdcnx2dotenv

I have also tried to do things such as python -m pip install setuptools --upgrade
un-install setuptools and install it again. restart my computer. and many other things. I’m not too sure what else to try (i’ve installed flask before this and it worked, I also can install other things like mitmproxy as an example)
Any ideas? Again, this is a Windows 10 machine and I just want to install dotenv for Python (version 3.6.4 if it matters).
Thank you.

Asked By: thatdevop

||

Answers:

You should install python-dotenv

pip3 install python-dotenv

or

pip install python-dotenv

i.e

C:UsersUSER>pip3 install python-dotenv
Collecting python-dotenv
  Downloading python_dotenv-0.8.2-py2.py3-none-any.whl
Installing collected packages: python-dotenv
Successfully installed python-dotenv-0.8.2

Refer this issue

Answered By: Morse
Categories: questions Tags: , , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.