Issue 1:
Numpy/Python version information: 1.19.1

We have compiled some common reasons and troubleshooting tips at:

https://numpy.org/devdocs/user/troubleshooting-importerror.html

Please note and check the following:

* The Python version is: Python3.8 from "/usr/local/bin/uwsgi"
* The NumPy version is: "1.19.1"

and make sure that they are the versions you expect.
Please carefully study the documentation linked above for further help.

Original error was: Error loading shared library ld-linux-x86-64.so.2: No such file or directory (needed by /usr/local/lib/python3.8/site-packages/numpy/core/_multiarray_umath.cpython-38-x86_64-linux-gnu.so)

Issue 2:
I'm trying to deploy a Flask-based application (Python 3) in AWS EC2 using Apache and mod_wsgi with all the necessary packages being installed in a miniconda environment.

Bellow you can find my app.wsgi file:

import sys
import logging
import site

site.addsitedir('/home/ubuntu/miniconda3/envs/app_env/lib/python3.6/site-packages/')
logging.basicConfig(stream=sys.stderr)
sys.path.insert(0,"/var/www/html/flaskapp/")
sys.stdout = sys.stderr

from app import app as application

Also, here's my Apache config file:

ServerAdmin webmaster@localhost
DocumentRoot /var/www/html

WSGIDaemonProcess flaskapp threads=5 python-home=/home/ubuntu/miniconda3/envs/app_env
WSGIScriptAlias / /var/www/html/flaskapp/app.wsgi

<Directory flaskapp>
WSGIProcessGroup flaskapp
WSGIApplicationGroup %{GLOBAL}
Order deny,allow
Allow from all
</Directory>

ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined

However, when I reload my server, I keep getting the same error:

[Wed Jul 18 12:24:12.897534 2018] [wsgi:error] [pid 10224:tid 140691482736384] [client 89.115.58.201:23351] mod_wsgi (pid=10224): Target WSGI script '/var/www/html/flaskapp/app.wsgi' cannot be loaded as Python module., referer: http://ec2-52-47-138-159.eu-west-3.compute.amazonaws.com/
[Wed Jul 18 12:24:12.897592 2018] [wsgi:error] [pid 10224:tid 140691482736384] [client 89.115.58.201:23351] mod_wsgi (pid=10224): Exception occurred processing WSGI script '/var/www/html/flaskapp/app.wsgi'., referer: http://ec2-52-47-138-159.eu-west-3.compute.amazonaws.com/
[Wed Jul 18 12:24:12.900007 2018] [wsgi:error] [pid 10224:tid 140691482736384] [client 89.115.58.201:23351] Traceback (most recent call last):, referer: http://ec2-52-47-138-159.eu-west-3.compute.amazonaws.com/
[Wed Jul 18 12:24:12.900033 2018] [wsgi:error] [pid 10224:tid 140691482736384] [client 89.115.58.201:23351] File "/home/ubuntu/miniconda3/envs/app_env/lib/python3.6/site-packages/numpy/core/__init__.py", line 16, in <module>, referer: http://ec2-52-47-138-159.eu-west-3.compute.amazonaws.com/
[Wed Jul 18 12:24:12.900045 2018] [wsgi:error] [pid 10224:tid 140691482736384] [client 89.115.58.201:23351] from . import multiarray, referer: http://ec2-52-47-138-159.eu-west-3.compute.amazonaws.com/
[Wed Jul 18 12:24:12.900062 2018] [wsgi:error] [pid 10224:tid 140691482736384] [client 89.115.58.201:23351] ImportError: cannot import name 'multiarray', referer: http://ec2-52-47-138-159.eu-west-3.compute.amazonaws.com/
[Wed Jul 18 12:24:12.900072 2018] [wsgi:error] [pid 10224:tid 140691482736384] [client 89.115.58.201:23351] , referer: http://ec2-52-47-138-159.eu-west-3.compute.amazonaws.com/
[Wed Jul 18 12:24:12.900075 2018] [wsgi:error] [pid 10224:tid 140691482736384] [client 89.115.58.201:23351] During handling of the above exception, another exception occurred:, referer: http://ec2-52-47-138-159.eu-west-3.compute.amazonaws.com/
[Wed Jul 18 12:24:12.900078 2018] [wsgi:error] [pid 10224:tid 140691482736384] [client 89.115.58.201:23351] , referer: http://ec2-52-47-138-159.eu-west-3.compute.amazonaws.com/
[Wed Jul 18 12:24:12.900083 2018] [wsgi:error] [pid 10224:tid 140691482736384] [client 89.115.58.201:23351] Traceback (most recent call last):, referer: http://ec2-52-47-138-159.eu-west-3.compute.amazonaws.com/
[Wed Jul 18 12:24:12.900171 2018] [wsgi:error] [pid 10224:tid 140691482736384] [client 89.115.58.201:23351] File "/var/www/html/flaskapp/app.wsgi", line 10, in <module>, referer: http://ec2-52-47-138-159.eu-west-3.compute.amazonaws.com/
[Wed Jul 18 12:24:12.900176 2018] [wsgi:error] [pid 10224:tid 140691482736384] [client 89.115.58.201:23351] from app import app as application, referer: http://ec2-52-47-138-159.eu-west-3.compute.amazonaws.com/
[Wed Jul 18 12:24:12.900181 2018] [wsgi:error] [pid 10224:tid 140691482736384] [client 89.115.58.201:23351] File "/var/www/html/flaskapp/app.py", line 4, in <module>, referer: http://ec2-52-47-138-159.eu-west-3.compute.amazonaws.com/
[Wed Jul 18 12:24:12.900184 2018] [wsgi:error] [pid 10224:tid 140691482736384] [client 89.115.58.201:23351] app = create_app(), referer: http://ec2-52-47-138-159.eu-west-3.compute.amazonaws.com/
[Wed Jul 18 12:24:12.900189 2018] [wsgi:error] [pid 10224:tid 140691482736384] [client 89.115.58.201:23351] File "/var/www/html/flaskapp/app/__init__.py", line 33, in create_app, referer: http://ec2-52-47-138-159.eu-west-3.compute.amazonaws.com/
[Wed Jul 18 12:24:12.900192 2018] [wsgi:error] [pid 10224:tid 140691482736384] [client 89.115.58.201:23351] from app.data import bp as data_bp, referer: http://ec2-52-47-138-159.eu-west-3.compute.amazonaws.com/
[Wed Jul 18 12:24:12.900197 2018] [wsgi:error] [pid 10224:tid 140691482736384] [client 89.115.58.201:23351] File "/var/www/html/flaskapp/app/data/__init__.py", line 18, in <module>, referer: http://ec2-52-47-138-159.eu-west-3.compute.amazonaws.com/
[Wed Jul 18 12:24:12.900200 2018] [wsgi:error] [pid 10224:tid 140691482736384] [client 89.115.58.201:23351] from app.data import views, referer: http://ec2-52-47-138-159.eu-west-3.compute.amazonaws.com/
[Wed Jul 18 12:24:12.900205 2018] [wsgi:error] [pid 10224:tid 140691482736384] [client 89.115.58.201:23351] File "/var/www/html/flaskapp/app/data/views.py", line 7, in <module>, referer: http://ec2-52-47-138-159.eu-west-3.compute.amazonaws.com/
[Wed Jul 18 12:24:12.900207 2018] [wsgi:error] [pid 10224:tid 140691482736384] [client 89.115.58.201:23351] from app.lca import mongo, referer: http://ec2-52-47-138-159.eu-west-3.compute.amazonaws.com/
[Wed Jul 18 12:24:12.900212 2018] [wsgi:error] [pid 10224:tid 140691482736384] [client 89.115.58.201:23351] File "/var/www/html/flaskapp/app/lca/__init__.py", line 3, in <module>, referer: http://ec2-52-47-138-159.eu-west-3.compute.amazonaws.com/
[Wed Jul 18 12:24:12.900215 2018] [wsgi:error] [pid 10224:tid 140691482736384] [client 89.115.58.201:23351] import brightway2 as bw2, referer: http://ec2-52-47-138-159.eu-west-3.compute.amazonaws.com/
[Wed Jul 18 12:24:12.900223 2018] [wsgi:error] [pid 10224:tid 140691482736384] [client 89.115.58.201:23351] File "/home/ubuntu/miniconda3/envs/app_env/lib/python3.6/site-packages/brightway2/__init__.py", line 2, in <module>, referer: http://ec2-52-47-138-159.eu-west-3.compute.amazonaws.com/
[Wed Jul 18 12:24:12.900226 2018] [wsgi:error] [pid 10224:tid 140691482736384] [client 89.115.58.201:23351] from bw2data import *, referer: http://ec2-52-47-138-159.eu-west-3.compute.amazonaws.com/
[Wed Jul 18 12:24:12.900231 2018] [wsgi:error] [pid 10224:tid 140691482736384] [client 89.115.58.201:23351] File "/home/ubuntu/miniconda3/envs/app_env/lib/python3.6/site-packages/bw2data/__init__.py", line 33, in <module>, referer: http://ec2-52-47-138-159.eu-west-3.compute.amazonaws.com/
[Wed Jul 18 12:24:12.900234 2018] [wsgi:error] [pid 10224:tid 140691482736384] [client 89.115.58.201:23351] from .project import projects, referer: http://ec2-52-47-138-159.eu-west-3.compute.amazonaws.com/
[Wed Jul 18 12:24:12.900239 2018] [wsgi:error] [pid 10224:tid 140691482736384] [client 89.115.58.201:23351] File "/home/ubuntu/miniconda3/envs/app_env/lib/python3.6/site-packages/bw2data/project.py", line 9, in <module>, referer: http://ec2-52-47-138-159.eu-west-3.compute.amazonaws.com/
[Wed Jul 18 12:24:12.900242 2018] [wsgi:error] [pid 10224:tid 140691482736384] [client 89.115.58.201:23351] from .utils import python_2_unicode_compatible, referer: http://ec2-52-47-138-159.eu-west-3.compute.amazonaws.com/
[Wed Jul 18 12:24:12.900246 2018] [wsgi:error] [pid 10224:tid 140691482736384] [client 89.115.58.201:23351] File "/home/ubuntu/miniconda3/envs/app_env/lib/python3.6/site-packages/bw2data/utils.py", line 19, in <module>, referer: http://ec2-52-47-138-159.eu-west-3.compute.amazonaws.com/
[Wed Jul 18 12:24:12.900249 2018] [wsgi:error] [pid 10224:tid 140691482736384] [client 89.115.58.201:23351] import stats_arrays as sa, referer: http://ec2-52-47-138-159.eu-west-3.compute.amazonaws.com/
[Wed Jul 18 12:24:12.900254 2018] [wsgi:error] [pid 10224:tid 140691482736384] [client 89.115.58.201:23351] File "/home/ubuntu/miniconda3/envs/app_env/lib/python3.6/site-packages/stats_arrays/__init__.py", line 5, in <module>, referer: http://ec2-52-47-138-159.eu-west-3.compute.amazonaws.com/
[Wed Jul 18 12:24:12.900257 2018] [wsgi:error] [pid 10224:tid 140691482736384] [client 89.115.58.201:23351] from .distributions import *, referer: http://ec2-52-47-138-159.eu-west-3.compute.amazonaws.com/
[Wed Jul 18 12:24:12.900262 2018] [wsgi:error] [pid 10224:tid 140691482736384] [client 89.115.58.201:23351] File "/home/ubuntu/miniconda3/envs/app_env/lib/python3.6/site-packages/stats_arrays/distributions/__init__.py", line 1, in <module>, referer: http://ec2-52-47-138-159.eu-west-3.compute.amazonaws.com/
[Wed Jul 18 12:24:12.900265 2018] [wsgi:error] [pid 10224:tid 140691482736384] [client 89.115.58.201:23351] from .base import UncertaintyBase, BoundedUncertaintyBase, referer: http://ec2-52-47-138-159.eu-west-3.compute.amazonaws.com/
[Wed Jul 18 12:24:12.900270 2018] [wsgi:error] [pid 10224:tid 140691482736384] [client 89.115.58.201:23351] File "/home/ubuntu/miniconda3/envs/app_env/lib/python3.6/site-packages/stats_arrays/distributions/base.py", line 5, in <module>, referer: http://ec2-52-47-138-159.eu-west-3.compute.amazonaws.com/
[Wed Jul 18 12:24:12.900273 2018] [wsgi:error] [pid 10224:tid 140691482736384] [client 89.115.58.201:23351] from ..utils import one_row_params_array, construct_params_array, referer: http://ec2-52-47-138-159.eu-west-3.compute.amazonaws.com/
[Wed Jul 18 12:24:12.900277 2018] [wsgi:error] [pid 10224:tid 140691482736384] [client 89.115.58.201:23351] File "/home/ubuntu/miniconda3/envs/app_env/lib/python3.6/site-packages/stats_arrays/utils.py", line 3, in <module>, referer: http://ec2-52-47-138-159.eu-west-3.compute.amazonaws.com/
[Wed Jul 18 12:24:12.900280 2018] [wsgi:error] [pid 10224:tid 140691482736384] [client 89.115.58.201:23351] import numpy as np, referer: http://ec2-52-47-138-159.eu-west-3.compute.amazonaws.com/
[Wed Jul 18 12:24:12.900287 2018] [wsgi:error] [pid 10224:tid 140691482736384] [client 89.115.58.201:23351] File "/home/ubuntu/miniconda3/envs/app_env/lib/python3.6/site-packages/numpy/__init__.py", line 142, in <module>, referer: http://ec2-52-47-138-159.eu-west-3.compute.amazonaws.com/
[Wed Jul 18 12:24:12.900290 2018] [wsgi:error] [pid 10224:tid 140691482736384] [client 89.115.58.201:23351] from . import add_newdocs, referer: http://ec2-52-47-138-159.eu-west-3.compute.amazonaws.com/
[Wed Jul 18 12:24:12.900295 2018] [wsgi:error] [pid 10224:tid 140691482736384] [client 89.115.58.201:23351] File "/home/ubuntu/miniconda3/envs/app_env/lib/python3.6/site-packages/numpy/add_newdocs.py", line 13, in <module>, referer: http://ec2-52-47-138-159.eu-west-3.compute.amazonaws.com/
[Wed Jul 18 12:24:12.900298 2018] [wsgi:error] [pid 10224:tid 140691482736384] [client 89.115.58.201:23351] from numpy.lib import add_newdoc, referer: http://ec2-52-47-138-159.eu-west-3.compute.amazonaws.com/
[Wed Jul 18 12:24:12.900302 2018] [wsgi:error] [pid 10224:tid 140691482736384] [client 89.115.58.201:23351] File "/home/ubuntu/miniconda3/envs/app_env/lib/python3.6/site-packages/numpy/lib/__init__.py", line 8, in <module>, referer: http://ec2-52-47-138-159.eu-west-3.compute.amazonaws.com/
[Wed Jul 18 12:24:12.900305 2018] [wsgi:error] [pid 10224:tid 140691482736384] [client 89.115.58.201:23351] from .type_check import *, referer: http://ec2-52-47-138-159.eu-west-3.compute.amazonaws.com/
[Wed Jul 18 12:24:12.900310 2018] [wsgi:error] [pid 10224:tid 140691482736384] [client 89.115.58.201:23351] File "/home/ubuntu/miniconda3/envs/app_env/lib/python3.6/site-packages/numpy/lib/type_check.py", line 11, in <module>, referer: http://ec2-52-47-138-159.eu-west-3.compute.amazonaws.com/
[Wed Jul 18 12:24:12.900313 2018] [wsgi:error] [pid 10224:tid 140691482736384] [client 89.115.58.201:23351] import numpy.core.numeric as _nx, referer: http://ec2-52-47-138-159.eu-west-3.compute.amazonaws.com/
[Wed Jul 18 12:24:12.900318 2018] [wsgi:error] [pid 10224:tid 140691482736384] [client 89.115.58.201:23351] File "/home/ubuntu/miniconda3/envs/app_env/lib/python3.6/site-packages/numpy/core/__init__.py", line 26, in <module>, referer: http://ec2-52-47-138-159.eu-west-3.compute.amazonaws.com/
[Wed Jul 18 12:24:12.900321 2018] [wsgi:error] [pid 10224:tid 140691482736384] [client 89.115.58.201:23351] raise ImportError(msg), referer: http://ec2-52-47-138-159.eu-west-3.compute.amazonaws.com/
[Wed Jul 18 12:24:12.900336 2018] [wsgi:error] [pid 10224:tid 140691482736384] [client 89.115.58.201:23351] ImportError: , referer: http://ec2-52-47-138-159.eu-west-3.compute.amazonaws.com/
[Wed Jul 18 12:24:12.900352 2018] [wsgi:error] [pid 10224:tid 140691482736384] [client 89.115.58.201:23351] Importing the multiarray numpy extension module failed. Most, referer: http://ec2-52-47-138-159.eu-west-3.compute.amazonaws.com/
[Wed Jul 18 12:24:12.900355 2018] [wsgi:error] [pid 10224:tid 140691482736384] [client 89.115.58.201:23351] likely you are trying to import a failed build of numpy., referer: http://ec2-52-47-138-159.eu-west-3.compute.amazonaws.com/
[Wed Jul 18 12:24:12.900357 2018] [wsgi:error] [pid 10224:tid 140691482736384] [client 89.115.58.201:23351] If you're working with a numpy git repo, try `git clean -xdf` (removes all, referer: http://ec2-52-47-138-159.eu-west-3.compute.amazonaws.com/
[Wed Jul 18 12:24:12.900360 2018] [wsgi:error] [pid 10224:tid 140691482736384] [client 89.115.58.201:23351] files not under version control). Otherwise reinstall numpy., referer: http://ec2-52-47-138-159.eu-west-3.compute.amazonaws.com/
[Wed Jul 18 12:24:12.900362 2018] [wsgi:error] [pid 10224:tid 140691482736384] [client 89.115.58.201:23351] , referer: http://ec2-52-47-138-159.eu-west-3.compute.amazonaws.com/
[Wed Jul 18 12:24:12.900365 2018] [wsgi:error] [pid 10224:tid 140691482736384] [client 89.115.58.201:23351] Original error was: cannot import name 'multiarray', referer: http://ec2-52-47-138-159.eu-west-3.compute.amazonaws.com/
[Wed Jul 18 12:24:12.900369 2018] [wsgi:error] [pid 10224:tid 140691482736384] [client 89.115.58.201:23351] , referer: http://ec2-52-47-138-159.eu-west-3.compute.amazonaws.com/

I've tried multiple times to reinstall numpy and create a new conda environment but the problem seems to be persisting. Moreover, if I activate my conda env I can import directly multiarray (from numpy.core import multiarray). The app also runs perfectly if I load it directly as a localhost (python app.py). Is there some peculiarity when trying to import numpy via mod_wsgi?

Thanks!