Python spacy 模块无法在 Apache 上运行
我有一个在 Windows 中的 Apache24 上运行的 Django 应用程序。我正在使用Python 3.9.5。该应用程序运行良好。但是,在安装 spacy 模块并将其导入到 Python 文件中(如下所示)后,
import spacy
应用程序挂起并且 Apache 不再响应。 spacy 模块与 Django 的服务器(python manage.py runserver)配合良好,
我的设置很好。但如果您想知道,这里有一些。
在 settings.py 文件中:
ALLOWED_HOSTS = ['localhost']
在 C:\Apache24\conf\httpd.conf 文件中
WSGIApplicationGroup %{GLOBAL}
LoadFile "c:/users/administrator/appdata/local/programs/python/python39/python39.dll"
LoadModule wsgi_module "c:/users/administrator/appdata/local/programs/python/python39/lib/site-packages/mod_wsgi/server/mod_wsgi.cp39-win_amd64.pyd"
WSGIScriptAlias / "C:/Users/Administrator/Documents/myproject/myproject/wsgi.py"
WSGIPythonHome "c:/users/administrator/appdata/local/programs/python/python39"
WSGIPythonPath "C:/Users/Administrator/Documents/myproject/"
Alias /static C:/Users/Administrator/Documents/myproject/static
<Directory C:/Users/Administrator/Documents/myproject/static>
Require all granted
</Directory>
<Directory C:/Users/Administrator/Documents/myproject/myproject/>
<Files wsgi.py>
Require all granted
</Files>
</Directory>
知道为什么 spacy 模块在 Apache 服务器上不起作用以及如何修复它吗?
I have a Django application running on Apache24 in Windows. I am using Python 3.9.5. The application works fine. But after installing the spacy module and importing it on a Python file as follows,
import spacy
the application is hanging and the Apache no longer responses. The spacy module works fine with Django's server (python manage.py runserver)
My settings are fine. But in case you wonder, here are some of them.
In the settings.py file:
ALLOWED_HOSTS = ['localhost']
In the C:\Apache24\conf\httpd.conf file
WSGIApplicationGroup %{GLOBAL}
LoadFile "c:/users/administrator/appdata/local/programs/python/python39/python39.dll"
LoadModule wsgi_module "c:/users/administrator/appdata/local/programs/python/python39/lib/site-packages/mod_wsgi/server/mod_wsgi.cp39-win_amd64.pyd"
WSGIScriptAlias / "C:/Users/Administrator/Documents/myproject/myproject/wsgi.py"
WSGIPythonHome "c:/users/administrator/appdata/local/programs/python/python39"
WSGIPythonPath "C:/Users/Administrator/Documents/myproject/"
Alias /static C:/Users/Administrator/Documents/myproject/static
<Directory C:/Users/Administrator/Documents/myproject/static>
Require all granted
</Directory>
<Directory C:/Users/Administrator/Documents/myproject/myproject/>
<Files wsgi.py>
Require all granted
</Files>
</Directory>
Any idea why the spacy module doesn't work on the Apache server and how to fix it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论