簡體   English   中英

wsgi.py'無法作為Python模塊加載-Python3

[英]wsgi.py' cannot be loaded as Python module - Python3

我正在使用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在PYTHONPATH中。 從python shell測試導入django

Python 3.6.1 (default, Dec 2015, 13:05:11)
[GCC 4.8.2] on linux
>>>import django
>>>

您需要設置已針對您使用的python 3版本編譯的mod_wsgi。 請參考此處以驗證您的mod_wsgi是針對哪個Python版本編譯的-> http://modwsgi.readthedocs.io/en/develop/user-guides/checking-your-installation.html

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM