title: Configure python path using mod_wsgi
body: <p>I am trying to set up a simple flask app on an ec2 instance with apache2 server and mod_wsgi. Seem to be having disproportionate amount of diffculty configuring the correct python path for mod_wsgi to use.</p>
  <p>I have placed code snippets below.</p>
  <p>The error I get the apache2 log is:</p>
  <pre><code>Traceback (most recent call last):
    File &quot;/var/www/html/flaskapp_tut/flaskapp_tut.wsgi&quot;, line 7, in &lt;module&gt;
      from flaskapp_tut import app as application
  ]  File &quot;/var/www/html/flaskapp_tut/flaskapp_tut.py&quot;, line 1, in &lt;module&gt;
  from flask import Flask
   ImportError: No module named flask
  </code></pre>
  <p>flask is definitely installed via anaconda installation, however clearly the wrong version of python is being used by mod_wsgi.</p>
  <p>The log files says its using:
  apache/2.4.7 (Ubuntu) mod_wsgi/3.4 Python/2.7.6 configured -- resuming normal operations</p>
  <p>However I am using python 3.x, and the anaconda installation show when I use the command &quot;which python&quot; ie /home/ubuntu/anaconda3/bin/python</p>
  <p>the mod_wsgi documentation says you can configure the python path with:
  WSGIPythonHome /home/ubuntu/anaconda3/bin/python, however I do not know where to place this configuration.</p>
  <p>Would appreciate any assistance.  This seems as though it should be a lot more straightforard than it is, according to the steps I am using as a guide:
  <a href="http://www.datasciencebytes.com/bytes/2015/02/24/running-a-flask-app-on-aws-ec2/" rel="nofollow noreferrer">http://www.datasciencebytes.com/bytes/2015/02/24/running-a-flask-app-on-aws-ec2/</a></p>
  <p>flaskapp_tut.wsgi</p>
  <pre><code>#!/home/ubuntu/anaconda3/bin/python
  
  import sys
  sys.path.insert(0, '/var/www/html/flaskapp_tut')
  sys.path.append('/home/ubuntu/anaconda3/bin/python')
  
  from flaskapp_tut import app as application
  </code></pre>
  <p>flaskapp_tut.py</p>
  <pre><code>from flask import Flask
  app = Flask(__name__)
  
  @app.route('/')
  def hello_world():
     return 'Hello from Flask!'
  
  if __name__ == '__main__':
    app.run()
  </code></pre>
  <p>Settings within the 000-default.conf file</p>
  <pre><code>    DocumentRoot /var/www/html
  
      WSGIDaemonProcess flaskapp_tut threads=5
      WSGIScriptAlias / /var/www/html/flaskapp_tut/flaskapp_tut.wsgi
  
      &lt;Directory flaskapp_tut&gt;
          WSGIProcessGroup flaskapp_tut
          WSGIApplicationGroup %{GLOBAL}
          Order deny,allow
          Allow from all
      &lt;/Directory&gt;
  </code></pre>