Ho un progetto Django che utilizza Celery per eseguire attività asincrone. Sto facendo il mio sviluppo su una macchina Windows XP.celery-django non trova le impostazioni
partire il mio server Django (python manage.py runserver 80
) funziona bene, ma il tentativo di avviare il Sedano Daemon (python manage.py celeryd start
) non riesce con il seguente errore:
ImportError: Impossibile importare impostazioni 'src.settings' (è il sys.path? Ha errori di sintassi?): Nessun modulo denominato src.settings
sys.path include 'C: \ development \ SpaceCorps \ src', quindi non sono sicuro del motivo per cui non riesce a trovare questo modulo.
Ecco l'output completo avvio il demone:
C:\development\SpaceCorps\src>python manage.py celeryd start
[2010-07-23 18:29:31,456: WARNING/MainProcess] ?[1;[email protected] v2.0.1 is starting.?[0m
[2010-07-23 18:29:31,456: WARNING/MainProcess] ?[1;33mC:\Program Files\Python26\lib\site-packages\celery-2.0.1-py2.6.egg\celery\bin\celeryd.py:206: UserWarning: Using settings.DEBUG leads to a memory leak, never use this setting in a production environment!
warnings.warn("Using settings.DEBUG leads to a memory leak, "?[0m
[2010-07-23 18:29:31,456: WARNING/MainProcess] ?[1;33mConfiguration ->
. broker -> amqp://[email protected]:5672/
. queues ->
. celery -> exchange:celery (direct) binding:celery
. concurrency -> 2
. loader -> djcelery.loaders.DjangoLoader
. logfile -> [stderr]@WARNING
. events -> OFF
. beat -> OFF?[0m
[2010-07-23 18:29:31,706: WARNING/MainProcess] ?[1;[email protected] has started.?[0m
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Program Files\Python26\lib\multiprocessing\forking.py", line 342, in main
self = load(from_parent)
File "C:\Program Files\Python26\lib\pickle.py", line 1370, in load
return Unpickler(file).load()
File "C:\Program Files\Python26\lib\pickle.py", line 858, in load
Traceback (most recent call last):
File "<string>", line 1, in <module>
dispatch[key](self)
File "C:\Program Files\Python26\lib\pickle.py", line 1090, in load_global
File "C:\Program Files\Python26\lib\multiprocessing\forking.py", line 342, in main
self = load(from_parent)
File "C:\Program Files\Python26\lib\pickle.py", line 1370, in load
klass = self.find_class(module, name)
File "C:\Program Files\Python26\lib\pickle.py", line 1124, in find_class
return Unpickler(file).load()
File "C:\Program Files\Python26\lib\pickle.py", line 858, in load
dispatch[key](self)
File "C:\Program Files\Python26\lib\pickle.py", line 1090, in load_global
__import__(module)
File "C:\Program Files\Python26\lib\site-packages\celery-2.0.1-py2.6.egg\celery\concurrency\processes\__init__.py", line 7, in <module>
from celery import log
File "C:\Program Files\Python26\lib\site-packages\celery-2.0.1-py2.6.egg\celery\log.py", line 8, in <module>
from celery import conf
File "C:\Program Files\Python26\lib\site-packages\celery-2.0.1-py2.6.egg\celery\conf.py", line 118, in <module>
ALWAYS_EAGER = _get("CELERY_ALWAYS_EAGER")
File "C:\Program Files\Python26\lib\site-packages\celery-2.0.1-py2.6.egg\celery\conf.py", line 109, in _get
value = getattr(settings, alias)
File "c:\development\django\django\utils\functional.py", line 276, in __getattr__
self._setup()
File "c:\development\django\django\conf\__init__.py", line 40, in _setup
self._wrapped = Settings(settings_module)
File "c:\development\django\django\conf\__init__.py", line 75, in __init__
raise ImportError("Could not import settings '%s' (Is it on sys.path? Does it have syntax errors?): %s" % (self.SETTINGS_MODULE, e))
ImportError: Could not import settings 'src.settings' (Is it on sys.path? Does it have syntax errors?): No module named src.settings
Ottima risposta! Ho avuto lo stesso problema su Windows con multiprocessing e Django, ma l'aggiunta del parametro --settings lo ha risolto. –
Ciò ha risolto l'errore iniziale. Tuttavia, ora celeryd genera un'eccezione: ImportError: nessun modulo denominato evertabs - evertabs è il nome del mio progetto. –