有一个类似的问题,但在我今天发现的特定情况下没有回答。
我在 openSUSE 上运行,并且在执行 syncdb 时遇到了这个神秘的错误。我发布我的发现以帮助处于类似情况的其他人。
> python manage.py syncdb
Creating tables ...
Installing custom SQL ...
Installing indexes ...
Traceback (most recent call last):
File "manage.py", line 14, in <module>
execute_manager(settings)
File "/usr/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 459, in execute_manager
utility.execute()
File "/usr/local/lib/python2.7/site-packages/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/core/management/base.py", line 196, in run_from_argv
self.execute(*args, **options.__dict__)
File "/usr/local/lib/python2.7/site-packages/django/core/management/base.py", line 232, in execute
output = self.handle(*args, **options)
File "/usr/local/lib/python2.7/site-packages/django/core/management/base.py", line 371, in handle
return self.handle_noargs(**options)
File "/usr/local/lib/python2.7/site-packages/django/core/management/commands/syncdb.py", line 164, in handle_noargs
call_command('loaddata', 'initial_data', verbosity=verbosity, database=db)
File "/usr/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 150, in call_command
return klass.execute(*args, **defaults)
File "/usr/local/lib/python2.7/site-packages/django/core/management/base.py", line 232, in execute
output = self.handle(*args, **options)
File "/usr/local/lib/python2.7/site-packages/django/core/management/commands/loaddata.py", line 239, in handle
(full_path, ''.join(traceback.format_exception(sys.exc_type,
UnboundLocalError: local variable 'full_path' referenced before assignment