title: Import Error: No module named Flask
body: <p>I am getting 500 internal server error when running my server with Flask,apache2, and Python 3.4.2.</p>
  
  <p>At first I installed Flask without creating virtual environment, so I thought that that could be a reason. However, I later created virtual environment for my app using:</p>
  
  <pre><code>python3.4 -m venv venv
  source venv/bin/activate
  (venv) pip3 install Flask
  </code></pre>
  
  <p>I checked by running my app using python3 <strong>__init.py</strong> and it was working on local.
  Then I reloaded my apache2 server, and still getting the same error. Please see below output from error log file:</p>
  
  <pre><code>mod_wsgi (pid=25667): Target WSGI script '/var/www/FlaskApp/flaskapp.wsgi' cannot be loaded as Python module.
  mod_wsgi (pid=25667): Exception occurred processing WSGI script '/var/www/FlaskApp/flaskapp.wsgi'.
  Traceback (most recent call last):
  File "/var/www/FlaskApp/flaskapp.wsgi", line 11, in &lt;module&gt;
  from XYZ import app as application
  File "/var/www/FlaskApp/XYZ/__init__.py", line 1, in &lt;module&gt;
  from flask import Flask, render_template
  ImportError: No module named flask
  </code></pre>
  
  <p>Any suggestions how to fix it?</p>
  
  <p>FlaskApp.conf file in the etc/apache2/sites-available</p>
  
  <p></p>
  
  <pre><code>&lt;VirtualHost *:80&gt;
  
  ServerName xyz.com
  
  ServerAlias www.xyz.com
  
  ServerAdmin contact@xyz.com
  WSGIScriptAlias / /var/www/FlaskApp/flaskapp.wsgi
  &lt;Directory /var/www/FlaskApp/XYZ/&gt;
  Order allow,deny
  Allow from all
  &lt;/Directory&gt;
  Alias /static /var/www/FlaskApp/XYZ/static
  &lt;Directory /var/www/FlaskApp/XYZ/static/&gt;
  Order allow,deny
  Allow from all
  &lt;/Directory&gt;
  ErrorLog ${APACHE_LOG_DIR}/error.log
  LogLevel warn
  CustomLog ${APACHE_LOG_DIR}/access.log combined
  &lt;/VirtualHost&gt;
  </code></pre>
  
  <p>Here's line from apache2 error log file:</p>
  
  <pre><code>AH00489: Apache/2.4.10 (Ubuntu) mod_wsgi/3.5 Python/2.7.8 configured -- resuming normal operations
  </code></pre>
  
  <p>It looks like mod_wsgi is trying to use 2.7.8 as opposed to 3.4. How do I fix that?</p>