ImportError:没有名为types的模块

时间:2017-02-21 22:10:10

标签: python flask mod-wsgi werkzeug

当我启动httpd服务器并访问应用程序URL时,我收到以下错误 -

[Tue Feb 21 22:01:51 2017] [error] [client 10.209.33.139] mod_wsgi (pid=15425): Target WSGI script '/scratch/gdudwadk/python-projects/newblog/app/wsgi.py' cannot be loaded as Python module.
[Tue Feb 21 22:01:51 2017] [error] [client 10.209.33.139] mod_wsgi (pid=15425): Exception occurred processing WSGI script '/scratch/gdudwadk/python-projects/newblog/app/wsgi.py'.
[Tue Feb 21 22:01:51 2017] [error] Traceback (most recent call last):
[Tue Feb 21 22:01:51 2017] [error]   File "/scratch/gdudwadk/python-projects/newblog/app/wsgi.py", line 7, in <module>
[Tue Feb 21 22:01:51 2017] [error]     from app import app as application
[Tue Feb 21 22:01:51 2017] [error]   File "/scratch/gdudwadk/python-projects/newblog/app/app.py", line 1, in <module>
[Tue Feb 21 22:01:51 2017] [error]     from flask import Flask
[Tue Feb 21 22:01:51 2017] [error]   File "/scratch/gdudwadk/python-projects/newblog/venv/lib/python2.6/site-packages/flask/__init__.py", line 17, in <module>
[Tue Feb 21 22:01:51 2017] [error]     from werkzeug.exceptions import abort
[Tue Feb 21 22:01:51 2017] [error]   File "/scratch/gdudwadk/python-projects/newblog/venv/lib/python2.6/site-packages/werkzeug/__init__.py", line 17, in <module>
[Tue Feb 21 22:01:51 2017] [error]     from types import ModuleType
[Tue Feb 21 22:01:51 2017] [error] ImportError: No module named types

在我的机器换​​成新机器后,这种情况就开始了。以前的应用程序工作正常。

1 个答案:

答案 0 :(得分:0)

我在/etc/httpd/conf.d/wsgi.conf中找到了对python2.7的一个引用,以及导致该问题的原因。删除后,应用程序启动并运行..谢谢!