Pandas import to Apache server causes a timeout error

I have a Django project running on an Apache server.

I installed pandas and want to use it to start working with data - however, something strange is happening.

At any time, when I use import pandas in a production environment, the server will freeze and (after a while) issue 408 timeouts.

I can comment on the pandas part, and the server responds normally without any problems. I cannot recreate it in the development environment or on the command line using django.

Here is the httpd-app.conf :

 Alias /tooltrack/static "C:/Users/myfolder/Bitnami Django Stack Projects/tooltrack/static/" <Directory "C:/Users/myfolder/Bitnami Django Stack Projects/tooltrack/static/"> Options +MultiViews AllowOverride All <IfVersion < 2.3 > Order allow,deny Allow from all </IfVersion> <IfVersion >= 2.3> Require all granted </IfVersion> <IfVersion < 2.3 > Order allow,deny Allow from all </IfVersion> <IfVersion >= 2.3> Require all granted </IfVersion> </Directory> WSGIScriptAlias / 'C:/Users/myfolder/Bitnami Django Stack projects/tooltrack/tooltrack/wsgi.py' <Directory "C:/Users/myfolder/Bitnami Django Stack projects/tooltrack/tooltrack"> Options +MultiViews AllowOverride All <IfVersion < 2.3 > Order allow,deny Allow from all </IfVersion> <IfVersion >= 2.3> Require all granted </IfVersion> <IfVersion < 2.3 > Order allow,deny Allow from all </IfVersion> <IfVersion >= 2.3> Require all granted </IfVersion> </Directory> <Directory "C:/Users/myfolder/Bitnami Django Stack projects/tooltrack"> Options +MultiViews AllowOverride All <IfVersion < 2.3 > Order allow,deny Allow from all </IfVersion> <IfVersion >= 2.3> Require all granted </IfVersion> </Directory> 

I know that it hangs when importing pandas because of this:

 def panda_dataframe_r(): print 'importing pandas ' + str(timezone.now()) import pandas print 'import done ' + str(timezone.now()) 

I can see importing pandas in the log, however the following import done should not be

Any help is much appreciated!

+5
source share
1 answer

Try adding:

 WSGIApplicationGroup %{GLOBAL} 

The various scientific packages he will need will not work in Python sub-interpreters. This directive will force the use of the context of the main interpreter.

+11
source

Source: https://habr.com/ru/post/1258172/


All Articles