Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fatal Python error: PyEval_AcquireThread

I just put up a django application online and i'm getting this error in my error log

Fatal Python error: PyEval_AcquireThread: NULL new thread state

I have seen a few similar questions online, but they do not explain this error.

like image 767
user1940979 Avatar asked Jul 20 '26 18:07

user1940979


2 Answers

The problem can appear if apache mod_wsgi and mod_python are both enabled. Try

sudo a2dismod python
sudo service apache2 restart
like image 120
azmeuk Avatar answered Jul 22 '26 15:07

azmeuk


This tends to indicate that your mod_wsgi is compiled for a different Python version and/or a different Python installation than the Python virtual environment or Python installation it is trying to use at runtime.

In other words, you are mixing compiled shared library and extension modules from different Python installations. This can cause all sorts of problems.

Go through the checks in:

  • http://code.google.com/p/modwsgi/wiki/CheckingYourInstallation

to understand how your mod_wsgi has been built and verify it is what you expect it to be.

like image 27
Graham Dumpleton Avatar answered Jul 22 '26 15:07

Graham Dumpleton