Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flask run not recognizing python-dotenv on windows

Tags:

python

flask

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.

like image 366
Steve Fibich Avatar asked Mar 05 '26 15:03

Steve Fibich


1 Answers

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.

like image 162
lyndipc Avatar answered Mar 08 '26 05:03

lyndipc