[英]Python + WAMP + Django --> ImportError: No module named os
I've installed WAMPServer (latest).我已经安装了 WAMPServer(最新)。 Python 2.6 and Django 1.4.
Python 2.6 和 Django 1.4。
Everything looks to be good up until I start running my server.在我开始运行我的服务器之前,一切看起来都很好。 I get Internal Server Error.
我收到内部服务器错误。 Apache error log shows the following:
Apache错误日志显示如下:
[Sun Apr 08 16:11:27 2012] [error] [client ::1] mod_wsgi (pid=1040): Target WSGI script 'C:/wamp/www/testproject/django.wsgi' cannot be loaded as Python module.
[Sun Apr 08 16:11:27 2012] [error] [client ::1] mod_wsgi (pid=1040): Exception occurred processing WSGI script 'C:/wamp/www/testproject/django.wsgi'.
[Sun Apr 08 16:11:27 2012] [error] Traceback (most recent call last):
[Sun Apr 08 16:11:27 2012] [error] File "C:/wamp/www/testproject/django.wsgi", line 1, in <module>
[Sun Apr 08 16:11:27 2012] [error] import os, sys
[Sun Apr 08 16:11:27 2012] [error] ImportError: No module named os
I've got all my Environment variables and such set up.我已经设置了所有环境变量和此类设置。 Using the Django provided server, it all works.
使用 Django 提供的服务器,一切正常。 I want to use Apache.
我想使用 Apache。
Your help is greatly appreciated.非常感谢您的帮助。
This can occur when your Python/mod_wsgi installation has been done wrong.当您的 Python/mod_wsgi 安装错误时,可能会发生这种情况。 Key things to check are:
要检查的关键事项是:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.