Код: Выделить всё
import numpy
def application(environ, start_response):
status = '200 OK'
output = b'Hello World!'
response_headers = [('Content-type', 'text/plain'),
('Content-Length', str(len(output)))]
start_response(status, response_headers)
return [output]
Код: Выделить всё
mod_wsgi (pid=187553): Failed to exec Python script file '/var/www/html/test/app.wsgi'.
mod_wsgi (pid=187553): Exception occurred processing WSGI script '/var/www/html/test/app.wsgi'.
Traceback (most recent call last):
File "/var/www/html/test/venv/lib64/python3.14/site-packages/numpy/_core/__init__.py", line 22, in
from . import multiarray
File "/var/www/html/test/venv/lib64/python3.14/site-packages/numpy/_core/multiarray.py", line 11, in
from . import _multiarray_umath, overrides
ImportError: /var/www/html/test/venv/lib64/python3.14/site-packages/numpy/_core/_multiarray_umath.cpython-314-x86_64-linux-gnu.so: failed to map segment from shared object
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/var/www/html/test/venv/lib64/python3.14/site-packages/numpy/__init__.py", line 112, in
from numpy.__config__ import show_config
File "/var/www/html/test/venv/lib64/python3.14/site-packages/numpy/__config__.py", line 4, in
from numpy._core._multiarray_umath import (
......
)
File "/var/www/html/test/venv/lib64/python3.14/site-packages/numpy/_core/__init__.py", line 48, in
raise ImportError(msg) from exc
ImportError:
IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!
Importing the numpy C-extensions failed. This error can happen for
many reasons, often due to issues with your setup or how NumPy was
installed.
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.14 from "/var/www/html/test/venv/bin/python"
* The NumPy version is: "2.3.5"
and make sure that they are the versions you expect.
Please carefully study the documentation linked above for further help.
Original error was: /var/www/html/test/venv/lib64/python3.14/site-packages/numpy/_core/_multiarray_umath.cpython-314-x86_64-linux-gnu.so: failed to map segment from shared object
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/var/www/html/test/app.wsgi", line 3, in
from test import application
File "/var/www/html/test/test.py", line 1, in
import numpy
File "/var/www/html/test/venv/lib64/python3.14/site-packages/numpy/__init__.py", line 117, in
raise ImportError(msg) from e
ImportError: Error importing numpy: you should not try to import numpy from
its source directory; please exit the numpy source tree, and relaunch
your python interpreter from there.
mod_wsgi (pid=187552): Failed to exec Python script file '/var/www/html/test/app.wsgi'.
mod_wsgi (pid=187552): Exception occurred processing WSGI script '/var/www/html/test/app.wsgi'.
Traceback (most recent call last):
File "/var/www/html/test/venv/lib64/python3.14/site-packages/numpy/_core/__init__.py", line 22, in
from . import multiarray
File "/var/www/html/test/venv/lib64/python3.14/site-packages/numpy/_core/multiarray.py", line 11, in
from . import _multiarray_umath, overrides
ImportError: /var/www/html/test/venv/lib64/python3.14/site-packages/numpy/_core/_multiarray_umath.cpython-314-x86_64-linux-gnu.so: failed to map segment from shared object
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/var/www/html/test/venv/lib64/python3.14/site-packages/numpy/__init__.py", line 112, in
from numpy.__config__ import show_config
File "/var/www/html/test/venv/lib64/python3.14/site-packages/numpy/__config__.py", line 4, in
from numpy._core._multiarray_umath import (
......
)
File "/var/www/html/test/venv/lib64/python3.14/site-packages/numpy/_core/__init__.py", line 48, in
raise ImportError(msg) from exc
ImportError:
IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!
Importing the numpy C-extensions failed. This error can happen for
many reasons, often due to issues with your setup or how NumPy was
installed.
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.14 from "/var/www/html/test/venv/bin/python"
* The NumPy version is: "2.3.5"
and make sure that they are the versions you expect.
Please carefully study the documentation linked above for further help.
Original error was: /var/www/html/test/venv/lib64/python3.14/site-packages/numpy/_core/_multiarray_umath.cpython-314-x86_64-linux-gnu.so: failed to map segment from shared object
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/var/www/html/test/app.wsgi", line 3, in
from test import application
File "/var/www/html/test/test.py", line 1, in
import numpy
File "/var/www/html/test/venv/lib64/python3.14/site-packages/numpy/__init__.py", line 117, in
raise ImportError(msg) from e
ImportError: Error importing numpy: you should not try to import numpy from
its source directory; please exit the numpy source tree, and relaunch
your python interpreter from there.
Код: Выделить всё
ServerName test.local
ErrorLog logs/test-error_log
CustomLog logs/test-access_log combined
WSGIScriptAlias / /var/www/html/test/app.wsgi
WSGIDaemonProcess test processes=2 threads=15 display-name=%{GROUP} python-home=/var/www/html/test/venv
WSGIProcessGroup test
Require all granted
Код: Выделить всё
mod_wsgi (pid=189077): Failed to exec Python script file '/var/www/html/test/app.wsgi'.
mod_wsgi (pid=189077): Exception occurred processing WSGI script '/var/www/html/test/app.wsgi'.
Traceback (most recent call last):
File "/var/www/html/test/app.wsgi", line 3, in
from test import application
File "/var/www/html/test/test.py", line 1, in
import numpy
File "/usr/local/lib64/python3.14/site-packages/numpy/__init__.py", line 112, in
from numpy.__config__ import show_config
File "/usr/local/lib64/python3.14/site-packages/numpy/__config__.py", line 4, in
from numpy._core._multiarray_umath import (
......
)
File "/usr/local/lib64/python3.14/site-packages/numpy/_core/__init__.py", line 22, in
from . import multiarray
File "/usr/local/lib64/python3.14/site-packages/numpy/_core/multiarray.py", line 11, in
from . import _multiarray_umath, overrides
RuntimeError: CPU dispatcher tracer already initlized
mod_wsgi (pid=189076): Failed to exec Python script file '/var/www/html/test/app.wsgi'.
mod_wsgi (pid=189076): Exception occurred processing WSGI script '/var/www/html/test/app.wsgi'.
Traceback (most recent call last):
File "/var/www/html/test/app.wsgi", line 3, in
from test import application
File "/var/www/html/test/test.py", line 1, in
import numpy
File "/usr/local/lib64/python3.14/site-packages/numpy/__init__.py", line 112, in
from numpy.__config__ import show_config
File "/usr/local/lib64/python3.14/site-packages/numpy/__config__.py", line 4, in
from numpy._core._multiarray_umath import (
......
)
File "/usr/local/lib64/python3.14/site-packages/numpy/_core/__init__.py", line 22, in
from . import multiarray
File "/usr/local/lib64/python3.14/site-packages/numpy/_core/multiarray.py", line 11, in
from . import _multiarray_umath, overrides
RuntimeError: CPU dispatcher tracer already initlized
Код: Выделить всё
(venv) cpn@d3:/var/www/html/test$ python
Python 3.14.0 (main, Oct 17 2025, 00:00:00) [GCC 15.2.1 20251022 (Red Hat 15.2.1-3)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
>>>
Код: Выделить всё
root@d3:/etc/httpd/conf.d# python
Python 3.14.0 (main, Oct 17 2025, 00:00:00) [GCC 15.2.1 20251022 (Red Hat 15.2.1-3)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
>>>
Подробнее здесь: https://stackoverflow.com/questions/798 ... -fedora-43