My Flask Application is crashing when I'm trying to access it.
This is similar error to this or this. However, my set-up seems correct.
flask.cli.NoAppException: The file/path provided (server) does not appear to exist. Please verify the path is correct. If app is not on PYTHONPATH, ensure the extension is .py
My environment variable correctly set.
export FLASK_APP=server.py
export FLASK_DEBUG=1
My server file is server.py
, and I don't have any __init__.py
in the directory.
I don't recall having change anything special in the code. Where does the bug could come from?
This error may be a sign that an import is not found. To see which import is missing, try to run your server.py file with the python interpreter:
python yourapp.py
Example of output :
Traceback (most recent call last):
File "yourapp.py", line 4, in <module>
from flask_httpauth import HTTPBasicAuth
ImportError: No module named flask_httpauth
Source (and other leads)
The issue was that some package were missing or corrupted.
I reinstalled everything with pip3 install -r requirements.txt --ignore-installed
and now it works fine.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With