I'm unable to get a shell with rb-site.  I'm unsure of how this wraps 
Django, and what I could do to troubleshoot it, so any pointers are 
welcome.  I'm trying to get this setup on Red Hat Enterprise Linux 
Workstation release 6.5, and I've been successful so far, and even upgraded 
Review Board to version 1.7.25.  However, in all the effort to get Python 
2.7 installed, I think I've run into the dependency hell situation. 
 Although the web application seems to be running fine, I'm concerned about 
the way my  rb-site manage shell/upgrade might be broken.

I can run rb-site manage /var/www/reviewboard.example.com *help*

But, when I 

rb-site manage /var/www/reviewboard.example.com *shell*

I get this error output 

Traceback (most recent call last):

  File "/usr/local/bin/rb-site", line 9, in <module>
    load_entry_point('ReviewBoard==1.7.25', 'console_scripts', 'rb-site')()
line 2055, in main
line 1972, in run
    site.run_manage_command(args[0], args[1:])
line 589, in run_manage_command
    execute_manager(reviewboard.settings, [__file__, cmd] + params)
line 459, in execute_manager
line 382, in execute
line 196, in run_from_argv
    self.execute(*args, **options.__dict__)
line 232, in execute
    output = self.handle(*args, **options)
line 371, in handle
    return self.handle_noargs(**options)
line 45, in handle_noargs
    from django.db.models.loading import get_models
line 40, in <module>
    backend = load_backend(connection.settings_dict['ENGINE'])
line 34, in __getattr__
    return getattr(connections[DEFAULT_DB_ALIAS], item)
line 92, in __getitem__
    backend = load_backend(db['ENGINE'])
line 24, in load_backend
    return import_module('.base', backend_name)
line 35, in import_module
line 16, in <module>
    raise ImproperlyConfigured("Error loading MySQLdb module: %s" % e)
django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: 
No module named MySQLdb

I searched around and figured out that because I'm on RHEL 6, that my 
Python2.7 environment in /usr/local/bin probably wasn't seeing the yum 
installed MySQL-python.  So, I used /usr/local/bin/easy_install-2.7 
MySQL-python to make it available in /usr/local/lib but that gave me this 

# /usr/local/bin/easy_install-2.7 MySQL-python
Searching for MySQL-python
Reading https://pypi.python.org/simple/MySQL-python/
Best match: MySQL-python 1.2.5
Processing MySQL-python-1.2.5.zip
Writing /tmp/easy_install-NGUKg7/MySQL-python-1.2.5/setup.cfg
Running MySQL-python-1.2.5/setup.py -q bdist_egg --dist-dir 
In file included from /usr/include/mysql/my_config.h:14,
                 from _mysql.c:44:
/usr/include/mysql/my_config_x86_64.h:1082:1: warning: "HAVE_WCSCOLL" 
In file included from /usr/local/include/python2.7/Python.h:8,
                 from _mysql.c:29:
/usr/local/include/python2.7/pyconfig.h:908:1: warning: this is the 
location of the previous definition
zip_safe flag not set; analyzing archive contents...
Adding MySQL-python 1.2.5 to easy-install.pth file

Processing dependencies for MySQL-python
Finished processing dependencies for MySQL-python

The  warning: "HAVE_WCSCOLL" redefined scares me into thinking I just broke 
my base system managed by yum; and I still can't run a shell.  Now I get 

[!] Unable to execute the manager command shell: cannot import name

This all led me to check if I had multiple versions of rb-site.  Lo and 
behold, there are two.  I don't know whether my site is running off Python 
2.6 or Python 2.7, but there is a /usr/bin/rb-site and also a 
/usr/local/bin/rb-site and the latter gets executed first because my $PATH 
lists /usr/local/bin before /usr/bin 

[root@codereview ~]# echo $PATH

Now if I run /usr/bin/rb-site manage /var/www/reviewboard.example.com shellI do 
get an interactive console!

[root@codereview ~]# /usr/bin/rb-site manage 
/var/www/reviewboard.example.com shell
Python 2.6.6 (r266:84292, Nov 21 2013, 10:50:32) 
[GCC 4.4.7 20120313 (Red Hat 4.4.7-4)] on linux2 

Type "help", "copyright", "credits" or "license" for more information.

I guess I should start over with a virtualenv setup, and possibly use 
RedHat Software Collections.  Starting over is a royal pain.

Can anyone confirm or deny which is the best approach to get this setup 
on Red Hat Enterprise Linux Workstation release 6.5



Get the Review Board Power Pack at http://www.reviewboard.org/powerpack/
Sign up for Review Board hosting at RBCommons: https://rbcommons.com/
Happy user? Let us know at http://www.reviewboard.org/users/
You received this message because you are subscribed to the Google Groups 
"reviewboard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to reviewboard+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to