UserWarning: NumPy was imported from a Python sub-interpreter

 





Whe you get the error message like:

[Fri Feb 09 14:44:16.693488 2024] [wsgi:error] [pid 13012:tid 281472973443264] [remote 81.82.223.150:61164] /usr/local/venvs/django_ner/lib/python3.10/site-packages/thinc/__init__.py:2: UserWarning: NumPy was imported from a Python sub-interpreter but NumPy does not properly support sub-interpreters. This will likely work for most users but might cause hard to track down issues or subtle bugs. A common user of the rare sub-interpreter feature is wsgi which also allows single-interpreter mode.
[Fri Feb 09 14:44:16.693987 2024] [wsgi:error] [pid 13012:tid 281472973443264] [remote 81.82.223.150:61164] Improvements in the case of bugs are welcome, but is not on the NumPy roadmap, and full support may require significant effort to achieve.
[Fri Feb 09 14:44:16.694006 2024] [wsgi:error] [pid 13012:tid 281472973443264] [remote 81.82.223.150:61164]   import numpy
[Fri Feb 09 14:44:36.134577 2024] [reqtimeout:info] [pid 13015:tid 281473074892992] [client 81.82.223.150:61165] AH01382: Request header read timeout


You have to add the line below to your httpd.conf:

# NumPy was imported from a Python sub-interpreter but NumPy does not properly support sub-interpreters.
WSGIApplicationGroup %{GLOBAL}

Source:

  • https://stackoverflow.com/questions/68849673/importing-numpy-shows-warning-when-running-in-mod-wsgi
  • https://code.google.com/archive/p/modwsgi/wikis/ApplicationIssues.wiki#Python_Simplified_GIL_State_API

Comments

Popular posts from this blog

Installing the Certbot Let’s Encrypt Client for NGINX on Amazon Linux 2

Deploy Nuxt.js app using Apache 2

psql: error: connection to server at "localhost" (127.0.0.1), port 5433 failed: ERROR: failed to authenticate with backend using SCRAM DETAIL: valid password not found