I have Django installed in a virtualenvwrapper
instance on which I've installed South. However
When calling python manage.py syncdb
the Django installation outside of the virtualenvwrapper
is called and does not find south
. How do I fix this?
[~/devground/django_gilgamesh]# pip install south
Downloading/unpacking south
Downloading South-0.8.4-py2.py3-none-any.whl (135kB): 135kB downloaded
Installing collected packages: south
Successfully installed south
Cleaning up...
(django_gilgamesh)sdye@dy-borg.com [~/devground/django_gilgamesh]# python manage.py syncdb
Traceback (most recent call last):
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/home/sdye/lib/python2.7/site-packages/django/core/management/__init__.py", line 399, in execute_from_command_line
utility.execute()
File "/home/sdye/lib/python2.7/site-packages/django/core/management/__init__.py", line 392, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/sdye/lib/python2.7/site-packages/django/core/management/base.py", line 242, in run_from_argv
self.execute(*args, **options.__dict__)
File "/home/sdye/lib/python2.7/site-packages/django/core/management/base.py", line 280, in execute
translation.activate('en-us')
File "/home/sdye/lib/python2.7/site-packages/django/utils/translation/__init__.py", line 130, in activate
return _trans.activate(language)
File "/home/sdye/lib/python2.7/site-packages/django/utils/translation/trans_real.py", line 188, in activate
_active.value = translation(language)
File "/home/sdye/lib/python2.7/site-packages/django/utils/translation/trans_real.py", line 177, in translation
default_translation = _fetch(settings.LANGUAGE_CODE)
File "/home/sdye/lib/python2.7/site-packages/django/utils/translation/trans_real.py", line 159, in _fetch
app = import_module(appname)
File "/home/sdye/lib/python2.7/site-packages/django/utils/importlib.py", line 40, in import_module
__import__(name)
ImportError: No module named south
EDIT: I've tried both 'south' and 'South' in settings.py. The settings.py file is shown below.
EDIT: Replaced traceback with new traceback generated using 'south' in settings.py and re-installing south
EDIT2: Output of which django-admin.py
/home/sdye/.virtualenvs/django_gilgamesh/bin/django-admin.py
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.6/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'p3)1ravw(zzt25-$tj0fd@r8^i1(0b1==tuk5e3ph32k8yjs20'
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
TEMPLATE_DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = (
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'south',
)
MIDDLEWARE_CLASSES = (
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
)
ROOT_URLCONF = 'django_gilgamesh.urls'
WSGI_APPLICATION = 'django_gilgamesh.wsgi.application'
Update: When testing on the command line import south
gives ImportError: No module named south
SOLVED: It appears python looks for south outside of the virtualenvwrapper instance. When I installed south after closing the virtualenv the migration worked. This creates another problem I will post in a new thread.
NOTE: since i'm using django installed in the virtualenvwrapper instance this should not happen
Anyone have an Idea how to fix this or a better explanation as to why this is happening?