title: When importing Numpy from Flask in Virtualenv Numpy gives multiarray import error
body: <p>I'am trying to import numpy at flask <code>__init__.py</code> but it gives this error :</p>
  
  <pre><code>Importing the multiarray numpy extension module failed.  Most
  likely you are trying to import a failed build of numpy.
  If you're working with a numpy git repo, try `git clean -xdf` (removes all 
  files not under version control).  Otherwise reinstall numpy.
  </code></pre>
  
  <p>When I remove the import from flasks <code>__init__.py</code> everything works.
  When I do <code>from numpy.core import multiarray</code> in virtualenv everything works but importing it from wsgi is not working.</p>
  
  <p>here is the apache/site-available config file:</p>
  
  <pre><code>&lt;VirtualHost *:80&gt;
                  ServerName 192.168.0.1
                  ServerAdmin hello@world.com
                  WSGIScriptAlias / /home/bar/FlaskApp/FlaskApp/FlaskApp.wsgi
                  &lt;Directory /home/bar/FlaskApp/FlaskApp/&gt;
                          Require all granted
                  &lt;/Directory&gt;
                  Alias /static /home/bar/FlaskApp/FlaskApp/static
                  &lt;Directory /home/bar/FlaskApp/FlaskApp/static/&gt;
                          Require all granted
                  &lt;/Directory&gt;
                  ErrorLog ${APACHE_LOG_DIR}/error.log
                  LogLevel warn
                  CustomLog ${APACHE_LOG_DIR}/access.log combined
  &lt;/VirtualHost&gt;
  WSGIDaemonProcess FlaskApp python-path=/home/bar/FlaskApp:/home/bar/FlaskApp/FlaskApp/venv/lib/python3.5/site-packages
  WSGIProcessGroup FlaskApp
  </code></pre>
  
  <p>and here is wsgi file:</p>
  
  <pre><code>#!/usr/bin/python
  import sys
  import logging
  logging.basicConfig(stream=sys.stderr)
  sys.path.insert(0,"/home/bar/FlaskApp")
  
  from FlaskApp import app as application
  application.secret_key = 'FlaskApp'
  </code></pre>
  
  <p>Thanks</p>
  
  <p>Additional Info:
  I have no problems importing other modules like pandas, flask or os.
  Originally i import pandas so error comes as a pandas dependency error.
  from <code>/var/log/apache/error.log</code>:</p>
  
  <pre><code>Traceback (most recent call last):
      File "/home/bar/FlaskApp/FlaskApp/FlaskApp.wsgi", line 7, in &lt;module&gt;
          from FlaskApp import app as application
      File "/home/bar/FlaskApp/FlaskApp/__init__.py", line 3, in &lt;module&gt;
          from myscript import myclass
      File "/home/bar/FlaskApp/FlaskApp/myscript.py", line 1, in &lt;module&gt;
          import pandas as pd
      File "/home/bar/FlaskApp/FlaskApp/venv/lib/python3.5/site-packages/pandas/__init__.py", line$
          "Missing required dependencies {0}".format(missing_dependencies))
          ImportError: Missing required dependencies ['numpy']
  </code></pre>
  
  <p>Here is the error log when i tried to import numpy directly from <code>__init__.py</code>:</p>
  
  <pre><code>Traceback (most recent call last):
      File "/home/bar/FlaskApp/FlaskApp/FlaskApp.wsgi", line 7, in &lt;module&gt;
          from FlaskApp import app as application
      File "/home/bar/FlaskApp/FlaskApp/__init__.py", line 3, in &lt;module&gt;
          import numpy as np
      File "/home/bar/FlaskApp/FlaskApp/venv/lib/python3.5/site-packages/numpy/__init__.py", line 142, in &lt;module&gt;
          from . import add_newdocs
      File "/home/bar/FlaskApp/FlaskApp/venv/lib/python3.5/site-packages/numpy/add_newdocs.py", line 13, in &lt;module&gt;
          from numpy.lib import add_newdoc
      File "/home/bar/FlaskApp/FlaskApp/venv/lib/python3.5/site-packages/numpy/lib/__init__.py", line 8, in &lt;module&gt;
          from .type_check import *
      File "/home/bar/FlaskApp/FlaskApp/venv/lib/python3.5/site-packages/numpy/lib/type_check.py", line 11, in &lt;module&gt;
          import numpy.core.numeric as _nx
      File "/home/bar/FlaskApp/FlaskApp/venv/lib/python3.5/site-packages/numpy/core/__init__.py", line 24, in &lt;module&gt;
          raise ImportError(msg)
      ImportError:
      Importing the multiarray numpy extension module failed.  Most
      likely you are trying to import a failed build of numpy.
      If you're working with a numpy git repo, try `git clean -xdf` (removes all
      files not under version control).  Otherwise reinstall numpy.
  </code></pre>
  
  <p>It works without a problem when i try to import numpy in venv in a python session.</p>
  
  <pre><code>(venv) bar@bar:~/FlaskApp/FlaskApp$ python3
  Python 3.5.2 (default, Nov 17 2016, 17:05:23) 
  [GCC 5.4.0 20160609] on linux
  Type "help", "copyright", "credits" or "license" for more information.
  &gt;&gt;&gt; import numpy as np
  &gt;&gt;&gt; from numpy.core import multiarray
  &gt;&gt;&gt; multiarray.__file__
  '/home/bar/FlaskApp/FlaskApp/venv/lib/python3.5/site-packages/numpy/core/multiarray.cpython-35m-x86_64-linux-gnu.so'
  &gt;&gt;&gt; 
  </code></pre>