question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

NoAppException: The file/path provided (autoapp) does not appear to exist.

See original GitHub issue

I’ve followed the README for this project but flask.cli keeps throwing me this exception when I try to run flask.

NoAppException: The file/path provided (autoapp) does not appear to exist.  Please 
verify the path is correct.  If app is not on PYTHONPATH, ensure the extension is .py

StackOverflow seems to think it’s an issue with exporting FLASK_APP=autoapp.py vs FLASK_APP=autoapp. I’ve tried them both in addition to using the absolute path for the above two variations.

Any thoughts how I can fix this?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:2
  • Comments:12

github_iconTop GitHub Comments

6reactions
nick13jaremekcommented, Feb 17, 2017

Hello there.

I was struggling with a similar issue as @rsivapr and it had me investigating a while. However, my issue was a bit more sutile:

  • Also on Ubuntu, version 16.04.
  • Created a fresh virtualenv, installing the dependencies specified in the requirements.txt file of the cookie-cutter-based Flask repo I’m working on.
  • Exported the Flask env variables as stated by @gitmeister: FLASK_APP=autoapp.py and FLASK_DEBUG=1.
  • Had the autoapp.py file located in the same directory I was within my terminal session.
  • Launched flask app via the flask run command.
  • Entered localhost:5000 on my web browser.
  • Got the following error message:
NoAppException: The file/path provided (autoapp) does not appear to exist.  Please verify the path is correct.  If app is not on PYTHONPATH, ensure the extension is .py

Then I tried the following: running python autoapp.py to check its output. It turns out I got a quite helpful message, that pointed me out to the ultimate error:

ImportError: No module named requests

Finally, I ran pip freeze to confirm I did not have the requests module in the list, neither in the requirements.txt file.

The solution was to add the requests module to the requirements.txt file and run pip install again within the proper virtualenv.

Although the issue in the end could be considered similar to @rsivapr’s, I wonder why the flask run command does not yield a more descriptive error message.

I hope this Github issue comments, along with this one, help other Flask users when facing a similar error.

6reactions
jordan-wrightcommented, Dec 28, 2016

This happened to me when I had a circular import.

You can try to debug by opening the console on the Traceback page and running the command __import__(app_id). If there’s an error on the import, you’ll see it there.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Flask "Error: The file/path provided does not appear to exist ...
This situation occurs when you have an ImportError which is not propagated through to your terminal. Check all of your files for invalid ......
Read more >
[Flask] I'm missing something about these Flask cookiecutter ...
NoAppException : The file/path provided (manage) does not appear to exist. Please verify the path is correct. If app is not on PYTHONPATH, ......
Read more >
Flask Documentation - Read the Docs
By default, Flask does not include a database abstraction layer, form validation or any- thing else where different libraries already exist ...
Read more >
Merge pull request #2490 from davidism/cli-review - CogtoSrc
You can instruct Flask to look for the application in a different module by. exporting the ``FLASK_APP`` environment variable. It can be either...
Read more >
Command Line Interface — Flask Documentation (2.2.x)
The flask command is installed by Flask, not your application; it must be ... The development server is provided for convenience, but is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found