This is error log when i'm trying to setup with Python 3.3, Apache 2.2 and use mod_wsgi-3.4.ap22.win32-py3.3.zip at http://www.lfd.uci.edu/~gohlke/pythonlibs/
mod_wsgi (pid=4940): Target WSGI script 'C:/www/h.wsgi' cannot be loaded as Python module.
mod_wsgi (pid=4940): Exception occurred processing WSGI script 'C:/www/h.wsgi'.
Traceback (most recent call last):\r
File "C:\\Python33\\Lib\\pkgutil.py", line 504, in find_loader\r
return importlib.find_loader(fullname, path)\r
File "C:\\Python33\\Lib\\importlib\\__init__.py", line 64, in find_loader\r
loader = sys.modules[name].__loader__\r
AttributeError: 'module' object has no attribute '__loader__'\r
\r
The above exception was the direct cause of the following exception:\r
\r
Traceback (most recent call last):\r
File "C:/www/h.wsgi", line 5, in <module>\r
application = Flask(__name__)\r
File "C:\\Python33\\lib\\site-packages\\flask\\app.py", line 331, in __init__\r
instance_path = self.auto_find_instance_path()\r
File "C:\\Python33\\lib\\site-packages\\flask\\app.py", line 622, in auto_find_instance_path\r
prefix, package_path = find_package(self.import_name)\r
File "C:\\Python33\\lib\\site-packages\\flask\\helpers.py", line 661, in find_package\r
loader = pkgutil.get_loader(root_mod_name)\r
File "C:\\Python33\\Lib\\pkgutil.py", line 482, in get_loader\r
return find_loader(fullname)\r
File "C:\\Python33\\Lib\\pkgutil.py", line 510, in find_loader\r
raise ImportError(msg.format(fullname, type(ex), ex)) from ex\r
ImportError: Error while finding loader for '_mod_wsgi_293471048e599ca28a13db229cd884c8' (<class 'AttributeError'>: 'module' object has no attribute '__loader__')\r
and Browser show "Internal Server Error".
I don't know why because when i'm trying to setup with Python 2.7, Apache 2.2 and mod_wsgi-3.4.ap22.win32-py2.7.zip, it's OK
Somebody help me, thank so much!
P.s:
httpd.conf settings
<VirtualHost *:80>
ServerName webmaster@localhost
WSGIScriptAlias / C:/www/h.wsgi
<Directory "C:/www">
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
and my app
from flask import Flask
application = Flask(__name__)
@application.route('/')
def hello_world():
return "Hello"
if __name__ == '__main__':
application.run()
it's work okay when i change to python 2.7