I have three python versions installed in my system:
python3.5
python3.6
python3.8
I have created a flask app which is waterchain.py
and setup my .flaskenv
as shown below:
FLASK_APP=waterchain.py
FLASK_ENV=production
Now when I do a flask run, I get this error:
ModuleNotFoundError: No module named 'pymongo'
This is because although I have installed all the modules in python3.6
by default flask run chooses to run it on latest python version that is python3.8
. Now in order to run all those apps, I would have to reinstall all the pip dependencies for python3.8
. When I do a py -3.6 waterchain.py
everything runs smoothly. Can someone point me a way to change default python running version for my flask app?