2013-10-28 66 views
0

我一直在努力獲得設置在mac osx10.6.8上的本地django安裝。運行syncdb無法識別我已安裝的應用程序。Django本地安裝syncdb配置不當

admins-macbook:myproject Admin$ python manage.py syncdb 
Traceback (most recent call last): 
    File "manage.py", line 10, in <module> 
    execute_from_command_line(sys.argv) 
    File "/Users/Admin/myapp/lib/python2.7/site-packages/django/core/management/__init__.py", line 443, in execute_from_command_line 
    utility.execute() 
    File "/Users/Admin/myapp/lib/python2.7/site-packages/django/core/management/__init__.py", line 382, in execute 
    self.fetch_command(subcommand).run_from_argv(self.argv) 
    File "/Users/Admin/myapp/lib/python2.7/site-packages/django/core/management/__init__.py", line 261, in fetch_command 
    klass = load_command_class(app_name, subcommand) 
    File "/Users/Admin/myapp/lib/python2.7/site-packages/django/core/management/__init__.py", line 69, in load_command_class 
    module = import_module('%s.management.commands.%s' % (app_name, name)) 
    File "/Users/Admin/myapp/lib/python2.7/site-packages/django/utils/importlib.py", line 35, in import_module 
    __import__(name) 
    File "/Users/Admin/myapp/lib/python2.7/site-packages/south/management/commands/__init__.py", line 10, in <module> 
    import django.template.loaders.app_directories 
    File "/Users/Admin/myapp/lib/python2.7/site-packages/django/template/loaders/app_directories.py", line 23, in <module> 
    raise ImproperlyConfigured('ImportError %s: %s' % (app, e.args[0])) 
django.core.exceptions.ImproperlyConfigured: ImportError haystack: cannot import name openProc 

我已經安裝在requirements.txt所有的應用程序,他們在

lib/python2.7/site-packages/ 

目錄中。它在我的pythonpath上:

admins-macbook:myproject Admin$ echo $PATH 
/Users/Admin/myapp/lib/python2.7/site-packages:(... etc.) 

我該如何正確運行syncdb?感謝您的想法!

+0

你安裝了草堆? – suhailvs

+0

是的,我跑了'pip install'。它安裝在site-packages目錄中,並可在我的urlconf中使用。如果我在我的設置中註釋乾草堆,則下一個應用程序會產生相同的錯誤。等等等等。你有什麼想法可以幫助嗎?謝謝! –

+0

您可能需要使用'virtualenv'。並嘗試使用'pip install'逐個安裝軟件包。 – suhailvs

回答

0

您可能已經安裝了pip install haystack這是錯誤的。

你需要pip install django-haystack

安裝dyango haystack請正確請參閱本SO question