While working on my Python project which runs on an Ubuntu server using Apache, I carelessly added the sklearn package using pip and my REST api stopped working. I spent some time debugging apache, which didn’t write anything to error.log nor access.log. Hard to find, I had to use the good old print() debug method and placed them all over the Django wsgi script.
Since the unit tests ran, it must have been a difference between console python and wsgi. I realized it was an import statement in my Django views.py that caused the hang. And this solved it (in apache.conf):
WSGIApplicationGroup %{GLOBAL}
The module that hung on import was TensorFlow. Might be it doesn’t work running it in a sub interpreter at this time.