cannot import name multiarray Django Apache2
<p>I am currently running a django app on an ec2 with apache. The app works fine when I run it using djangos runserver command. However I receive a 'cannot import name multiarray' when I run it using apache. I have tried reinstalling numpy and various packages many times and have still not had any luck. Below is my .conf file for apache. I am using python3.4 and have recently updated pip within my venv. I can provide more information if necessary. </p>

<pre><code>    Include conf-available/serve-cgi-bin.conf
    WSGISCRIPTALIAS /site /home/ubuntu/site/initsite/wsgi.py
    WSGIDaemonProcess site_group threads=15 display-name=%{GROUP} python-path='/home/ubuntu/site:/home/ubuntu/site/envsite/lib/python3.4/site-packages'
    &lt;Directory /home/ubuntu/site&gt;
           &lt;files wsgi.py&gt;
              Require all granted
            &lt;/Files&gt;
        &lt;/Directory&gt;
        &lt;Location /site&gt;
             WSGIProcessGroup site_group    
        &lt;/Location&gt;
        Alias /site1/ /home/ubuntu/site/fullsite/static/css
        &lt;Directory /home/ubuntu/site/fullsite/static/css&gt;
            Require all granted
            AllowOverride All
        &lt;/Directory&gt;
</code></pre>

<p>Traceback:</p>

<pre><code>File "/home/ubuntu/site/envsite/lib/python3.4/site-packages/django/core/handlers/exception.py" in inner
  39.             response = get_response(request)

File "/home/ubuntu/site/envsite/lib/python3.4/site-packages/django/core/handlers/base.py" in _get_response
  172.         resolver_match = resolver.resolve(request.path_info)

File "/home/ubuntu/site/envsite/lib/python3.4/site-packages/django/urls/resolvers.py" in resolve
  270.             for pattern in self.url_patterns:

File "/home/ubuntu/site/envsite/lib/python3.4/site-packages/django/utils/functional.py" in __get__
  35.         res = instance.__dict__[self.name] = self.func(instance)

File "/home/ubuntu/site/envsite/lib/python3.4/site-packages/django/urls/resolvers.py" in url_patterns
  313.         patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)

File "/home/ubuntu/site/envsite/lib/python3.4/site-packages/django/utils/functional.py" in __get__
  35.         res = instance.__dict__[self.name] = self.func(instance)

File "/home/ubuntu/site/envsite/lib/python3.4/site-packages/django/urls/resolvers.py" in urlconf_module
  306.             return import_module(self.urlconf_name)

File "/usr/lib/python2.7/importlib/__init__.py" in import_module
  37.     __import__(name)

File "/home/ubuntu/site/initSite/urls.py" in &lt;module&gt;
  21.     url(r'', include('fullSite.urls')),

File "/home/ubuntu/site/envsite/lib/python3.4/site-packages/django/conf/urls/__init__.py" in include
  50.         urlconf_module = import_module(urlconf_module)

File "/usr/lib/python2.7/importlib/__init__.py" in import_module
  37.     __import__(name)

File "/home/ubuntu/site/fullSite/urls.py" in &lt;module&gt;
  2. from . import views

File "/home/ubuntu/site/fullSite/views.py" in &lt;module&gt;
  1. import numpy as np

File "/home/ubuntu/site/envsite/lib/python3.4/site-packages/numpy/__init__.py" in &lt;module&gt;
  180.     from . import add_newdocs

File "/home/ubuntu/site/envsite/lib/python3.4/site-packages/numpy/add_newdocs.py" in &lt;module&gt;
  13. from numpy.lib import add_newdoc

File "/home/ubuntu/site/envsite/lib/python3.4/site-packages/numpy/lib/__init__.py" in &lt;module&gt;
  8. from .type_check import *

File "/home/ubuntu/site/envsite/lib/python3.4/site-packages/numpy/lib/type_check.py" in &lt;module&gt;
  11. import numpy.core.numeric as _nx

File "/home/ubuntu/site/envsite/lib/python3.4/site-packages/numpy/core/__init__.py" in &lt;module&gt;
  14. from . import multiarray

Exception Type: ImportError at /
Exception Value: cannot import name multiarray
</code></pre>

<p>drwxrwxr-x 5 ubuntu ubuntu 4096 Oct  3 22:31 site</p>

<p>I can possibly spot three issues that may effect your setup.</p>

<p>Your virutalenv is placed inside your project itself, this in my experience sometimes leads to conflicts. Virtualenvs and the project should always be separated. May I suggest a structures such as:</p>

<p>/home/ubuntu/site  - django project files
   /home/ubuntu/virtualenv/ - for the virtualenv</p>

<p>The second issue is that you have placed the site and the virtualenv inside a user's home directly. Though you have set the top level directory permissions correctly, it may still be very likely that sub folders, files inside  <code>/home/ubuntu/site</code> or <code>/home/ubuntu/virtualenv/</code> may be inaccessible to the apache user. This is very likely to happen if you made additions changes after the initial permissions were set.</p>

<p>The third issue is that you may have a corrupted numpy installation, please uninstall and install again and make sure to use pip3 instead of pip. To be more specific: <code>pip3 install numpy</code></p>

python django apache numpy python-3.4