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.
Если я импортирую запросы, это работает. Файл конфигурации сайта Apache, настраивающий виртуальную среду:
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
Импорт numpy как из venv, так и из системного (от имени root) интерпретатора командной строки работает
(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
>>>
Я получаю сообщение об ошибке при импорте numpy из приложения Apache mod_wsgi в Fedora 43. Этого не происходит в Rocky Linux 9, рабочем сервере. [code]import numpy
return [output] [/code] Журнал ошибок: [code]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:
* 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:
* 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. [/code] Если я импортирую запросы, это работает. Файл конфигурации сайта Apache, настраивающий виртуальную среду: [code]
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
[/code] Когда я изменяю приведенную выше конфигурацию, чтобы не устанавливать переменную python-home и не использовать виртуальную среду, ошибка меняется на [code]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 [/code] Импорт numpy как из venv, так и из системного (от имени root) интерпретатора командной строки работает [code](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 >>> [/code] [code]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 >>> [/code] Есть идеи?