title: flask tutorial troubleshooting: ModuleNotFoundError: No module named 'app'
body: <p>I am having trouble running my run.py file. My file structure looks like this:<a href="https://i.stack.imgur.com/FBnkN.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/FBnkN.png" alt="enter image description here"></a></p>
  
  <p>With another python file called 'run.py' located in flask/bin along with python3. My run.py file is simply:</p>
  
  <pre><code>#!flask/bin/python3
  from app import app
  app.run(debug=True)
  </code></pre>
  
  <p>However running 'python3 run.py' throws the error:</p>
  
  <pre><code>$ python3 run.py
  Traceback (most recent call last):
  File "run.py", line 2, in &lt;module&gt;
  from app import app
  ModuleNotFoundError: No module named 'app'
  </code></pre>
  
  <p>app.py looks like:</p>
  
  <pre><code>from flask import Flask
  
  app = Flask(__name__)
  from app import views
  </code></pre>
  
  <p>I am confused about how to solve this as I have been messing with the directories such as putting app.py into the flask/bin folder and putting it outside of all folders shown in my directory above, but these methods have not worked for me. </p>