【发布时间】:2018-01-16 19:16:11
【问题描述】:
我正在使用 python3 来构建应用程序
[Tue Jan 16 19:07:13.587669 2018] [wsgi:error] [pid 22631:tid 140432910448384] [remote 172.19.217.162:48145] mod_wsgi (pid=22631): Target WSGI script '/u0/shsathya/html/captool/captool/wsgi.py' cannot be loaded as Python module.
[Tue Jan 16 19:07:13.587752 2018] [wsgi:error] [pid 22631:tid 140432910448384] [remote 172.19.217.162:48145] mod_wsgi (pid=22631): Exception occurred processing WSGI script '/u0/shsathya/html/captool/captool/wsgi.py'.
[Tue Jan 16 19:07:13.587979 2018] [wsgi:error] [pid 22631:tid 140432910448384] [remote 172.19.217.162:48145] Traceback (most recent call last):
[Tue Jan 16 19:07:13.588026 2018] [wsgi:error] [pid 22631:tid 140432910448384] [remote 172.19.217.162:48145] File "/u0/shsathya/html/captool/captool/wsgi.py", line 14, in <module>
[Tue Jan 16 19:07:13.588036 2018] [wsgi:error] [pid 22631:tid 140432910448384] [remote 172.19.217.162:48145] from django.core.wsgi import get_wsgi_application
[Tue Jan 16 19:07:13.588059 2018] [wsgi:error] [pid 22631:tid 140432910448384] [remote 172.19.217.162:48145] ImportError: No module named 'django.core'
【问题讨论】:
-
你没有安装 django。
-
我已经使用 pip3 实用程序安装了 django,并且我能够使用 django-admin 工具并能够运行独立的 django 项目
-
您的网络服务器设置为使用哪个版本的 Python?我怀疑它是 Python 2,而不是 Python 3。
-
如何检查我的 apache2 使用的 python 版本?以及如何将其更改为 python3?
-
要查看您使用的 Python 版本,请创建一个简单的 Python Web 应用程序,该应用程序只打印
sys.version的值。
标签: python django apache2 wsgi