python - 审查委员会设置问题 - 无法将目标 WSGI 脚本加载为 Python 模块

标签 python linux apache review-board

已完成审查委员会设置,但在访问 Apache 网络服务器时出现以下错误,请提出解决问题的建议。

Apache 网络服务器的错误日志:

[Fri May 22 13:17:47.175095 2015] [core:notice] [pid 23324] SELinux policy enabled; httpd running as context system_u:system_r:httpd_t:s0
[Fri May 22 13:17:47.176057 2015] [suexec:notice] [pid 23324] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Fri May 22 13:17:47.216294 2015] [auth_digest:notice] [pid 23324] AH01757: generating secret for digest authentication ...
[Fri May 22 13:17:47.217002 2015] [lbmethod_heartbeat:notice] [pid 23324] AH02282: No slotmem from mod_heartmonitor
[Fri May 22 13:17:47.292938 2015] [mpm_prefork:notice] [pid 23324] AH00163: Apache/2.4.6 (Red Hat Enterprise Linux) OpenSSL/1.0.1e-fips mod_wsgi/3.4 Python/2.7.5 configured -- resuming normal operations
[Fri May 22 13:17:47.292972 2015] [core:notice] [pid 23324] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'
[Fri May 22 13:18:04.915419 2015] [autoindex:error] [pid 23331] [client *.*.*.*:37923] AH01276: Cannot serve directory /var/www/code.development.com/htdocs/: No matching DirectoryIndex (index.html) found, and server-generated directory index forbidden by Options directive
[Fri May 22 13:18:24.855506 2015] [:error] [pid 23328] [client *.*.*.*:37924] mod_wsgi (pid=23328): Target WSGI script '/var/www/code.development.com/htdocs/reviewboard.wsgi' cannot be loaded as Python module.
[Fri May 22 13:18:24.855538 2015] [:error] [pid 23328] [client *.*.*.*:37924] mod_wsgi (pid=23328): Exception occurred processing WSGI script '/var/www/code.development.com/htdocs/reviewboard.wsgi'.
[Fri May 22 13:18:24.855561 2015] [:error] [pid 23328] [client *.*.*.*:37924] Traceback (most recent call last):
[Fri May 22 13:18:24.855577 2015] [:error] [pid 23328] [client *.*.*.*:37924]   File "/var/www/code.development.com/htdocs/reviewboard.wsgi", line 3, in <module>
[Fri May 22 13:18:24.855625 2015] [:error] [pid 23328] [client *.*.*.*:37924]     import pkg_resources
[Fri May 22 13:18:24.855636 2015] [:error] [pid 23328] [client *.*.*.*:37924]   File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 3011, in <module>
[Fri May 22 13:18:24.856109 2015] [:error] [pid 23328] [client *.*.*.*:37924]     parse_requirements(__requires__), Environment()
[Fri May 22 13:18:24.856121 2015] [:error] [pid 23328] [client *.*.*.*:37924]   File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 626, in resolve
[Fri May 22 13:18:24.856147 2015] [:error] [pid 23328] [client *.*.*.*:37924]     raise DistributionNotFound(req)
[Fri May 22 13:18:24.856167 2015] [:error] [pid 23328] [client *.*.*.*:37924] DistributionNotFound: Whoosh>=2.6

配置:

# python --version
Python 2.7.5

# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 7.1 (Maipo)

# mysql --version
mysql  Ver 14.14 Distrib 5.6.24, for Linux (x86_64) using  EditLine wrapper

# memcached -h
memcached 1.4.15

设置 -> ReviewBoard + Mysql + Memcache + Apache Web 服务器(httpd 服务)

# pip freeze
alabaster==0.7.4
Babel==1.3
backports.ssl-match-hostname==3.4.0.2
chardet==2.0.1
cloud-init==0.7.6
configobj==4.7.2
decorator==3.4.0
Django==1.6.11
django-evolution==0.7.5
django-haystack==2.3.1
django-pipeline==1.3.24
django-storages==1.1.8
Djblets==0.8.18
docutils==0.12
ecdsa==0.13
ethtool==0.8
feedparser==5.1.3
flup==1.0.2
futures==2.1.6
iniparse==0.4
IPy==0.75
Jinja2==2.7.3
jsonpatch==1.2
jsonpointer==1.0
kitchen==1.1.1
lxml==3.2.1
M2Crypto==0.21.1
Markdown==2.4.1
MarkupSafe==0.23
mercurial==2.6.2
mimeparse==0.1.3
MySQL-python==1.2.3
nose==1.3.0
paramiko==1.15.2
pciutils==1.7.3
Pillow==2.0.0
pillowfight==0.2
policycoreutils-default-encoding==0.1
prettytable==0.7.2
psycopg2==2.5.1
pycrypto==2.6.1
pycurl==7.19.0
Pygments==2.0.2
pygobject==3.8.2
pygpgme==0.3
pyliblzma==0.5.3
pyOpenSSL==0.13.1
python-dateutil==1.5
python-dmidecode==3.10.13
python-memcached==1.54
python-mimeparse==0.1.4
pytz==2015.4
pyudev==0.15
pyxattr==0.5.1
PyYAML==3.10
recaptcha-client==1.0.6
requests==1.1.0
ReviewBoard==2.0.15
rhnlib==2.5.65
rhsm==1.13.10
seobject==0.1
sepolicy==1.1
six==1.7.3
snowballstemmer==1.2.0
Sphinx==1.3.1
sphinx-rtd-theme==0.1.8
urlgrabber==3.10
urllib3==1.5
Whoosh==2.7.0
yum-metadata-parser==1.1.4

如果您需要有关完整设置的更多信息,请告诉我。

最佳答案

主要问题是 DistributionNotFound: Whoosh>=2.6,我安装了 2.7.0,因此我卸载了 Whoosh 包并安装了解决问题的 2.6.0 版本。

#pip uninstall Whoosh
#pip install Whoosh==2.6.0

关于python - 审查委员会设置问题 - 无法将目标 WSGI 脚本加载为 Python 模块,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30400170/

相关文章:

python - python中的绝对路径和相对路径问题

linux - 这个蛋糕上的命令是做什么的?

linux - 编写一个 Makefile 以自动获取文件名并创建具有相同名称的相应可执行文件

apache - _default_ :* and *:* in VirtualHost Context 之间的区别

c# - 控制台托管 WCF 服务 Http 可在 mono 和 IIS 下访问

regex - Apache 多重重写规则

python - 在 conda 中使用代理

python - 使用 Flask key 创建过程了解环境变量

python - 带超时的异步子进程

python - 如何测试列表的所有项目都是不相交的?