在views.py中导入nltk时,Django webapp(在Apache2服务器上)无限挂起 [英] Django webapp (on an Apache2 server) hangs indefintely when importing nltk in views.py

查看:54
本文介绍了在views.py中导入nltk时,Django webapp(在Apache2服务器上)无限挂起的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

要详细说明标题,我在导入nltk以在Django Web应用程序中使用时遇到了问题.我已将Web应用程序部署在apache2服务器上.当我在views.py中导入nltk时,网页拒绝加载,并在加载几分钟后最终超时.我已经使用pip安装了nltk.我已经使用pip安装了许多其他python软件包,这些python软件包在django中都可以毫无问题地引用.

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

  • 服务器操作系统:Ubuntu 14.04
  • Python:2.7.6
  • Django:1.8.2
  • Apache Web服务器: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.

谢谢!

推荐答案

我使用的网络栈与您和我遇到的问题完全相同.

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

您需要在站点的Apache配置文件中将WSGIApplicationGroup设置为%{GLOBAL}

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

WSGIApplicationGroup %{GLOBAL}


这篇关于在views.py中导入nltk时,Django webapp(在Apache2服务器上)无限挂起的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆