title: Django Numpy ImportError with Apache but not on runserver
body: <p>I've tried every other thread and their suggested solutions but without success so far.</p>
  <p>I have a Django app with a virtualenv and Apache 2.4 and mod_wsgi, which i developed on other server. Now, I'm migrating (rebuilding from scratch) everything on another server.</p>
  <p>While everything else works, when i tried to install pandas, the app served <strong>through Apache throws me an ImportError for Numpy.</strong></p>
  <pre><code>Original error was: /optilab/env/lib64/python3.6/site-packages/numpy/core/_multiarray_umath.cpython-36m-x86_64-linux-gnu.so: 
  failed to map segment from shared object
  </code></pre>
  <p>Thing is, <strong>this doesn't happen while using runserver with manage.py</strong> . Everything is the same: Python Version (3.6.8), Python Executable (/optilab/env/bin/python) except the Python Path order.</p>
  <p>For the testing runserver, this is the Python Path list:</p>
  <pre><code> ['/optilab',
   '/optilab/env/lib64/python3.6/site-packages',
   '/usr/lib64/python36.zip',
   '/usr/lib64/python3.6',
   '/usr/lib64/python3.6/lib-dynload',
   '/optilab/env/lib64/python3.6/site-packages',
   '/optilab/env/lib/python3.6/site-packages',
   '/home/appuser/.local/lib/python3.6/site-packages',
   '/usr/local/lib64/python3.6/site-packages',
   '/usr/local/lib/python3.6/site-packages',
   '/usr/lib64/python3.6/site-packages',
   '/usr/lib/python3.6/site-packages',
   '/env/lib64/python3.6/site-packages']
  </code></pre>
  <p>But, for the app served through Apache, the Python Path is:</p>
  <pre><code> ['/optilab',
   '/optilab/core',
   '/usr/lib64/python36.zip',
   '/usr/lib64/python3.6',
   '/usr/lib64/python3.6/lib-dynload',
   '/optilab/env/lib64/python3.6/site-packages',
   '/optilab/env/lib/python3.6/site-packages',
   '/usr/local/lib64/python3.6/site-packages',
   '/usr/local/lib/python3.6/site-packages',
   '/usr/lib64/python3.6/site-packages',
   '/usr/lib/python3.6/site-packages']
  </code></pre>
  <p>I suspect that the list order is the culprit for this problem, but it seems i'm not able to change it.</p>
  <p>My file structure is the following:</p>
  <pre><code>/optilab
       /core &lt;-- startproject directory
       /env  &lt;-- virtualenv files
       /static
       /media
       ... other apps
  </code></pre>
  <p>This is the first part of my apache config (BTW, I tried with python-path in WSGIDaemonProcess but didn't help):</p>
  <pre><code>
      WSGIPythonPath /optilab/env/lib64/python3.6/site-packages:/optilab/env/lib/python3.6/site-packages:/optilab:/optilab/core
  
      &lt;VirtualHost *:80&gt;
  
          ServerName optilab
          WSGIDaemonProcess optilab python-home=/optilab/env
          WSGIProcessGroup optilab
          WSGIApplicationGroup %{GLOBAL}
          WSGIScriptAlias / /optilab/core/wsgi.py
  
          &lt;Directory /optilab&gt;
              Require all granted
          &lt;/Directory&gt;
  
          &lt;Directory /optilab/core&gt;
              &lt;Files wsgi.py&gt;
                      Require all granted
              &lt;/Files&gt;
          &lt;/Directory&gt;
  
      ....
  </code></pre>
  <p>I tried everything but nothing worked.</p>