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.
File "/usr/local/bin/rb-site", line 9, in <module>
load_entry_point('ReviewBoard==1.7.25', 'console_scripts', 'rb-site')()
File "/usr/local/lib/python2.7/site-packages/ReviewBoard-1.7.25-py2.7.egg/reviewboard/cmdline/rbsite.py", line 2055, in main
File "/usr/local/lib/python2.7/site-packages/ReviewBoard-1.7.25-py2.7.egg/reviewboard/cmdline/rbsite.py", line 1972, in run
site.run_manage_command(args[0], args[1:])
File "/usr/local/lib/python2.7/site-packages/ReviewBoard-1.7.25-py2.7.egg/reviewboard/cmdline/rbsite.py", line 589, in run_manage_command
execute_manager(reviewboard.settings, [__file__, cmd] + params)
File "/usr/local/lib/python2.7/site-packages/Django-1.4.12-py2.7.egg/django/core/management/__init__.py", line 459, in execute_manager
File "/usr/local/lib/python2.7/site-packages/Django-1.4.12-py2.7.egg/django/core/management/__init__.py", line 382, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/local/lib/python2.7/site-packages/Django-1.4.12-py2.7.egg/django/core/management/base.py", line 196, in run_from_argv
self.execute(*args, **options.__dict__)
File "/usr/local/lib/python2.7/site-packages/Django-1.4.12-py2.7.egg/django/core/management/base.py", line 232, in execute
output = self.handle(*args, **options)
File "/usr/local/lib/python2.7/site-packages/Django-1.4.12-py2.7.egg/django/core/management/base.py", line 371, in handle
return self.handle_noargs(**options)
File "/usr/local/lib/python2.7/site-packages/Django-1.4.12-py2.7.egg/django/core/management/commands/shell.py", line 45, in handle_noargs
from django.db.models.loading import get_models
File "/usr/local/lib/python2.7/site-packages/Django-1.4.12-py2.7.egg/django/db/__init__.py", line 40, in <module>
backend = load_backend(connection.settings_dict['ENGINE'])
File "/usr/local/lib/python2.7/site-packages/Django-1.4.12-py2.7.egg/django/db/__init__.py", line 34, in __getattr__
return getattr(connections[DEFAULT_DB_ALIAS], item)
File "/usr/local/lib/python2.7/site-packages/Django-1.4.12-py2.7.egg/django/db/utils.py", line 92, in __getitem__
backend = load_backend(db['ENGINE'])
File "/usr/local/lib/python2.7/site-packages/Django-1.4.12-py2.7.egg/django/db/utils.py", line 24, in load_backend
return import_module('.base', backend_name)
File "/usr/local/lib/python2.7/site-packages/Django-1.4.12-py2.7.egg/django/utils/importlib.py", line 35, in import_module
File "/usr/local/lib/python2.7/site-packages/Django-1.4.12-py2.7.egg/django/db/backends/mysql/base.py", 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 output:
# /usr/local/bin/easy_install-2.7 MySQL-python
Searching for 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 /tmp/easy_install-NGUKg7/MySQL-python-1.2.5/egg-dist-tmp-hpusEI
In file included from /usr/include/mysql/my_config.h:14,
/usr/include/mysql/my_config_x86_64.h:1082:1: warning: "HAVE_WCSCOLL" redefined
In file included from /usr/local/include/python2.7/Python.h:8,
/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
Installed /usr/local/lib/python2.7/site-packages/MySQL_python-1.2.5-py2.7-linux-x86_64.egg
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
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
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