Django webapp (on an Apache2 server) hangs indefintely when importing nltk in views.py

左心房为你撑大大i 提交于 2021-02-08 06:47:09

问题


To elaborate a little more from the title, I'm having issues importing nltk to use in a django web app. I've deployed the web app on an apache2 server. When I import nltk in views.py, the web page refuses to load and eventually times out after a few minutes of loading. I've installed nltk using pip. I've used pip to install a number of other python packages which I've been able to reference without issue within django.

I haven't been able to find anything solid to explain why this would be happening. Here's what I'm working with

  • Server OS: Ubuntu 14.04
  • Python: 2.7.6
  • Django: 1.8.2
  • Apache Webserver: 2.4.7

Like I said, I haven't been able to find any good reasons for this so please feel free to ask for any other information you need.

Thanks!


回答1:


I am using the same web-stack as you and I had the exact same problem.

You need to set WSGIApplicationGroup to %{GLOBAL} in your site's Apache config file

WSGIApplicationGroup %{GLOBAL}




来源:https://stackoverflow.com/questions/30715896/django-webapp-on-an-apache2-server-hangs-indefintely-when-importing-nltk-in-vi

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