3

So I'm running python 3.7 on Windows and I have installed python-dotenv in my virtual environment as well as flask. I have a .flaskenv file in the root of my project where I execute flask run, it looks as if python/flask is not recognizing python-dotenv .flaskenv file it ignores my parameters and states that I do not have a FLASK_APP value assigned. This same setup works fine on a Linux workstation. Is there something different to configure on windows to get this to work?

Thanks ahead of time.

1
  • 1
    I am having the same issue, did you figure this out? I am going the opposite direction and have set up a cookiecutter, but it does not work after I template it. Commented Feb 13, 2019 at 17:31

2 Answers 2

2

I ran into the same issue and resolved it by executing python -m flask run instead of flask run. The -m allows modules to be located and executed.

Sign up to request clarification or add additional context in comments.

2 Comments

(This works for the same error on a mac as well as windows)
great! this works on W10
0

.flaskenv seems to be working fine on Windows 10. Have you tried creating a new file named .flaskenv, without specifying any extension, in Visual Studio Code? A .flaskenv file of FLASKENV FILE type gets automatically created. I have in there a single line FLASK_APP=yourFileName.py. Hope this helps.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.