我正在使用Openstack Liberty和Ubuntu 14.04。 安装openstack仪表板后,事情进展顺利,然后我决定卸载并重新安装openstack仪表板包,原因是同事错误地配置了SSL并更改了仪表板主题以进行自定义。现在,我收到以下错误。
mod_wsgi (pid=30567, process='horizon', application='cpph-ch01-blade02|/horizon'): Loading WSGI script '/usr/share/openstack-dashboard/openstack_dashboard/wsgi/django.wsgi'.
sys.path is: ['/usr/lib/python2.7', '/usr/lib/python2.7/plat-x86_64-linux-gnu', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload', '/usr/local/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages/PILcompat', '/usr/lib/python2.7/dist-packages/gst-0.10', '/usr/lib/python2.7/dist-packages/gtk-2.0', '/usr/lib/python2.7/dist-packages/ubuntu-sso-client']
Target WSGI script '/usr/share/openstack-dashboard/openstack_dashboard/wsgi/django.wsgi' cannot be loaded as Python module.
Exception occurred processing WSGI script '/usr/share/openstack-dashboard/openstack_dashboard/wsgi/django.wsgi'.
Traceback (most recent call last):
[:error] [pid 30567:tid 140400988059392] File "/usr/share/openstack-dashboard/openstack_dashboard/wsgi/django.wsgi", line 8, in <module>
[:error] [pid 30567:tid 140400988059392] from django.core.wsgi import get_wsgi_application
[:error] [pid 30567:tid 140400988059392] ImportError: No module named django.core.wsgi
在下面显示的目标脚本中,我打印了syspath。不确定这是否重要,但我有目标wsgi脚本 /usr/local/lib/python2.7/dist-packages/django/core/wsgi.py
1 import logging
2 import os
3 import sys
4 # print
5 print >>sys.stderr, "sys.path is: " + str(sys.path)
6 from django.core.wsgi import get_wsgi_application
7 from django.conf import settings
8 # Add this file path to sys.path in order to import settings
9 sys.path.insert(0, os.path.join(os.path.dirname(os.path.realpath(__file__)), '../..'))
10 os.environ['DJANGO_SETTINGS_MODULE'] = 'openstack_dashboard.settings'
11 sys.stdout = sys.stderr
12 sys.path.append("/usr/share/openstack-dashboard/")
13 application = get_wsgi_application()
我已经尝试多次重新安装它无济于事我无法重新安装python,因为这是一个生产环境。目前,我已将仪表板安装在不同的主机上,并将其作为解决方法连接到我的生产服务器。
我不是python开发人员,并且没有使用虚拟环境或与此相关的任何开发,这是一个简单的apt-get安装。