• Register
1 vote
388 views

Problem :

I am getting bellow flask app error
error: could not locate flask application. you did not provide the flask_app environment variable.
6.9k points

Please log in or register to answer this question.

1 Answer

0 votes

Solution :

When I dropped sudo from sudo flask run, Flask finds $FLASK_APP. But, I got the error message socket.error as: [Errno 13] Permission denied. I can't see a way around this, as Flask cannot find $FLASK_APP when I run as superuser. 

Still I managed to run Flask by changing the port from 80 to 5000 and dropping sudo with flask run. This is running fine now. 

I was able to run flask db init after dropping and recreating my database, and removing calls to db.create_all.

38.6k points

Related questions

0 votes
1 answer 17 views
17 views
Problem: Is there anyone who can help me find a solution : Error: could not locate flask application. you did not provide the flask_app environment variable?
asked Jun 10 Mezbah 130k points
0 votes
1 answer 6 views
6 views
Problem: Flask view function did not return a response?
asked Jul 6 Nahil 128k points
0 votes
1 answer 25 views
25 views
Problem: Give me an answer please : The method is not allowed for the requested url. flask
asked Jun 26 Sawyer Parviz 168k points
1 vote
1 answer 3k views
3k views
Problem: I installed flask in my system by running the command: pip install flask Collecting flask Downloading https://files.pythonhosted.org/packages/f2/28/2a03252dfb9ebf377f40fba6a7841b47083260bf8bd8e737b0c6952df83f/Flask-1.1.2-py2.py3-none-any.whl (94kB) |████████████████████████████████| ... operable program or batch file. Whats the problem running this can any one tell me? Thanks in advance.
asked May 12, 2020 samhaz 5k points
0 votes
1 answer 10 views
10 views
Problem: Modulenotfounderror: no module named 'flask'?
asked Jul 9 Nahil 128k points
0 votes
1 answer 83 views
83 views
Problem: Don't know how I got this : Modulenotfounderror: no module named 'flask.ext'
asked May 24 Irenka Kiri 85.5k points
0 votes
1 answer 33 views
33 views
Problem: I need someone’s assistance to solve my problem .. Importerror: cannot import name 'flask'
asked May 20 Ifra 43.4k points
0 votes
1 answer 72 views
72 views
Problem: Can anyone simplify this? : Importerror: cannot import name 'flask' from 'flask'
asked May 17 Sawyer Parviz 168k points
0 votes
1 answer 19 views
19 views
Problem: Is there anyone who can tell me what is the use of flask?
asked Apr 11 niyatiry 3.9k points
0 votes
1 answer 19 views
19 views
Problem: how to Solve this: flask pymongo HELP! I need help understanding this: flask pymongo Can someone please help solve this, I am new in python(). Someone have idea to solve this thanks!
asked Mar 13 Mashhoodch 13k points