Import Pandas on apache server causes timeout error

夙愿已清 提交于 2019-12-01 17:18:35

问题


I've got a Django project working on an Apache server.

I installed pandas and want to use it to start manipulating data - however something odd is happening.

Anytime I use the import pandas on the production environment, the server will hang up and (after a while) throw a 408 timeout error.

I can comment out the pandas portion and the server responds normally without issue. I can't recreate it in the development environment or command line interface with django.

Here are the httpd-app.conf file:

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 its hanging up on the import of pandas due to this:

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

I can see the importing pandas in the log, however no following import done

Any help is greatly appreciated!!


回答1:


Try adding:

WSGIApplicationGroup %{GLOBAL}

Various of the scientific packages that it is going to need will not work in Python sub interpreters. That directive will force the use of the main interpreter context.



来源:https://stackoverflow.com/questions/40028497/import-pandas-on-apache-server-causes-timeout-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!