Review Board Setup Issue - Target WSGI script cannot be loaded as Python module
Question: Complete Review Board set-up but getting following error on accessing Apache
web server, please suggest fix for the problem.

Error logs for Apache web server:

    
    
    [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
    

Configuration:

    
    
    # 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
    

Setup -> ReviewBoard + Mysql + Memcache + Apache Web Server(httpd service)

    
    
    # 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
    

Let me know if you need more information on complete set-up.


Answer: Main problem was with **DistributionNotFound: Whoosh>=2.6** , I had 2.7.0
installed, thus I uninstalled Whoosh package and installed 2.6.0 version which
solved the problem.

    
    
    #pip uninstall Whoosh
    #pip install Whoosh==2.6.0
    

