Django芹菜在启动时击败了pytz错误 [英] Django celery beat pytz error on startup

查看:248
本文介绍了Django芹菜在启动时击败了pytz错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在蓝色中,当尝试启动我的开发服务器,芹菜和芹菜时,我会收到以下错误消息。有一天,这件事第二天起作用,我没有改变任何可以解释这个的东西。我使用工头和一个Procfile.dev启动我的服务器,如下所示:

Out of the blue I get the following error when trying to start my dev server with celery and celery beat. One day this thing works next day it doesn't, I haven't changed anything that could explain this. I start my server using foreman and a Procfile.dev like so:

Procfile:

web: python manage.py runserver
celeryd: python manage.py celeryd -E -B --loglevel=INFO --concurrency=3
worker: python manage.py celerycam

命令:

foreman start -f Procfile.dev

像我说的这样从来没有给出任何错误。 StackTrace在下面:

Like I said this never gave any errors. Stacktrace is below:

14:18:44 celeryd.1  | [2013-03-01 14:18:44,216: INFO/Beat] Celerybeat: Starting...
14:18:44 celeryd.1  | [2013-03-01 14:18:44,224: WARNING/Beat] Process Beat:
14:18:44 celeryd.1  | [2013-03-01 14:18:44,224: WARNING/Beat] Traceback (most recent call last):
14:18:44 celeryd.1  | [2013-03-01 14:18:44,224: WARNING/MainProcess] celery@Allards-MacBook-Pro.local has started.
14:18:44 celeryd.1  | [2013-03-01 14:18:44,224: WARNING/Beat] File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/billiard/process.py", line 273, in _bootstrap
14:18:44 celeryd.1  | [2013-03-01 14:18:44,225: WARNING/Beat] self.run()
14:18:44 celeryd.1  | [2013-03-01 14:18:44,226: WARNING/Beat] File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/celery/beat.py", line 472, in run
14:18:44 celeryd.1  | [2013-03-01 14:18:44,227: WARNING/Beat] self.service.start(embedded_process=True)
14:18:44 celeryd.1  | [2013-03-01 14:18:44,227: WARNING/Beat] File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/celery/beat.py", line 401, in start
14:18:44 celeryd.1  | [2013-03-01 14:18:44,227: WARNING/Beat] humanize_seconds(self.scheduler.max_interval))
14:18:44 celeryd.1  | [2013-03-01 14:18:44,227: WARNING/Beat] File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/kombu/utils/__init__.py", line 234, in __get__
14:18:44 celeryd.1  | [2013-03-01 14:18:44,228: WARNING/Beat] value = obj.__dict__[self.__name__] = self.__get(obj)
14:18:44 celeryd.1  | [2013-03-01 14:18:44,229: WARNING/Beat] File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/celery/beat.py", line 439, in scheduler
14:18:44 celeryd.1  | [2013-03-01 14:18:44,229: WARNING/Beat] return self.get_scheduler()
14:18:44 celeryd.1  | [2013-03-01 14:18:44,229: WARNING/Beat] File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/celery/beat.py", line 434, in get_scheduler
14:18:44 celeryd.1  | [2013-03-01 14:18:44,229: WARNING/Beat] lazy=lazy)
14:18:44 celeryd.1  | [2013-03-01 14:18:44,229: WARNING/Beat] File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/celery/utils/imports.py", line 51, in instantiate
14:18:44 celeryd.1  | [2013-03-01 14:18:44,230: WARNING/Beat] return symbol_by_name(name)(*args, **kwargs)
14:18:44 celeryd.1  | [2013-03-01 14:18:44,230: WARNING/Beat] File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/djcelery/schedulers.py", line 124, in __init__
14:18:44 celeryd.1  | [2013-03-01 14:18:44,231: WARNING/Beat] Scheduler.__init__(self, *args, **kwargs)
14:18:44 celeryd.1  | [2013-03-01 14:18:44,231: WARNING/Beat] File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/celery/beat.py", line 158, in __init__
14:18:44 celeryd.1  | [2013-03-01 14:18:44,231: WARNING/Beat] self.setup_schedule()
14:18:44 celeryd.1  | [2013-03-01 14:18:44,231: WARNING/Beat] File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/djcelery/schedulers.py", line 130, in setup_schedule
14:18:44 celeryd.1  | [2013-03-01 14:18:44,232: WARNING/Beat] self.install_default_entries(self.schedule)
14:18:44 celeryd.1  | [2013-03-01 14:18:44,232: WARNING/Beat] File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/djcelery/schedulers.py", line 216, in schedule
14:18:44 celeryd.1  | [2013-03-01 14:18:44,232: WARNING/Beat] if self.schedule_changed():
14:18:44 celeryd.1  | [2013-03-01 14:18:44,232: WARNING/Beat] File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/djcelery/schedulers.py", line 161, in schedule_changed
14:18:44 celeryd.1  | [2013-03-01 14:18:44,232: WARNING/Beat] self._last_timestamp = now()
14:18:44 celeryd.1  | [2013-03-01 14:18:44,232: WARNING/Beat] File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/djcelery/utils.py", line 65, in now
14:18:44 celeryd.1  | [2013-03-01 14:18:44,233: WARNING/Beat] return timezone.localtime(timezone.now())
14:18:44 celeryd.1  | [2013-03-01 14:18:44,233: WARNING/Beat] File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/utils/timezone.py", line 222, in localtime
14:18:44 celeryd.1  | [2013-03-01 14:18:44,234: WARNING/Beat] timezone = get_current_timezone()
14:18:44 celeryd.1  | [2013-03-01 14:18:44,234: WARNING/Beat] File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/utils/timezone.py", line 130, in get_current_timezone
14:18:44 celeryd.1  | [2013-03-01 14:18:44,234: WARNING/Beat] return getattr(_active, "value", get_default_timezone())
14:18:44 celeryd.1  | [2013-03-01 14:18:44,234: WARNING/Beat] File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/utils/timezone.py", line 112, in get_default_timezone
14:18:44 celeryd.1  | [2013-03-01 14:18:44,234: WARNING/Beat] _localtime = pytz.timezone(settings.TIME_ZONE)
14:18:44 celeryd.1  | [2013-03-01 14:18:44,235: WARNING/Beat] File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/pytz/__init__.py", line 183, in timezone
14:18:44 celeryd.1  | [2013-03-01 14:18:44,236: WARNING/Beat] fp.close()
14:18:44 celeryd.1  | [2013-03-01 14:18:44,236: WARNING/Beat] IOError: [Errno 9] Bad file descriptor


$ b $我的已安装软件包的b

版本:

versions of my installed packages:

Django==1.4.1
celery==3.0.8
pytz==2012c

我已经尝试重新安装pytz,但是没有帮助。

I have tried re-installing pytz, but that didn't help.

有什么建议如何解决这个问题?

Any suggestions how to fix this?

编辑1

我已经尝试过Burhan Khalid的答案, IOError,但是会抛出一个新的错误。我试过两个地方粘贴zoneinfo数据,并导致不同的错误,您可以在下面找到:

I have tried Burhan Khalid's answer and this did fix the IOError, however a new error is thrown. I have tried two places to paste the zoneinfo data and they resulted in different errors, which you can find below:

当粘贴到usr / share / zoneinfo /像建议我得到这个:

When pasted into usr/share/zoneinfo/ like suggested I get this:

14:20:07 worker.1   | Traceback (most recent call last):
14:20:07 worker.1   |   File "manage.py", line 9, in <module>
14:20:07 worker.1   |     execute_from_command_line(sys.argv)
14:20:07 celeryd.1  | Traceback (most recent call last):
14:20:07 worker.1   |   File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/core/management/__init__.py", line 443, in execute_from_command_line
14:20:07 celeryd.1  |   File "manage.py", line 9, in <module>
14:20:07 web.1      | Traceback (most recent call last):
14:20:07 worker.1   |     utility.execute()
14:20:07 celeryd.1  |     execute_from_command_line(sys.argv)
14:20:07 web.1      |   File "manage.py", line 9, in <module>
14:20:07 worker.1   |   File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/core/management/__init__.py", line 382, in execute
14:20:07 celeryd.1  |   File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/core/management/__init__.py", line 443, in execute_from_command_line
14:20:07 web.1      |     execute_from_command_line(sys.argv)
14:20:07 worker.1   |     self.fetch_command(subcommand).run_from_argv(self.argv)
14:20:07 celeryd.1  |     utility.execute()
14:20:07 web.1      |   File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/core/management/__init__.py", line 443, in execute_from_command_line
14:20:07 worker.1   |   File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/core/management/__init__.py", line 252, in fetch_command
14:20:07 celeryd.1  |   File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/core/management/__init__.py", line 382, in execute
14:20:07 web.1      |     utility.execute()
14:20:07 worker.1   |     app_name = get_commands()[subcommand]
14:20:07 celeryd.1  |     self.fetch_command(subcommand).run_from_argv(self.argv)
14:20:07 web.1      |   File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/core/management/__init__.py", line 382, in execute
14:20:07 worker.1   |   File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/core/management/__init__.py", line 101, in get_commands
14:20:07 celeryd.1  |   File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/core/management/__init__.py", line 252, in fetch_command
14:20:07 web.1      |     self.fetch_command(subcommand).run_from_argv(self.argv)
14:20:07 worker.1   |     apps = settings.INSTALLED_APPS
14:20:07 celeryd.1  |     app_name = get_commands()[subcommand]
14:20:07 web.1      |   File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/core/management/__init__.py", line 252, in fetch_command
14:20:07 worker.1   |   File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/utils/functional.py", line 184, in inner
14:20:07 celeryd.1  |   File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/core/management/__init__.py", line 101, in get_commands
14:20:07 web.1      |     app_name = get_commands()[subcommand]
14:20:07 worker.1   |     self._setup()
14:20:07 celeryd.1  |     apps = settings.INSTALLED_APPS
14:20:07 web.1      |   File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/core/management/__init__.py", line 101, in get_commands
14:20:07 worker.1   |   File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/conf/__init__.py", line 42, in _setup
14:20:07 celeryd.1  |   File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/utils/functional.py", line 184, in inner
14:20:07 web.1      |     apps = settings.INSTALLED_APPS
14:20:07 worker.1   |     self._wrapped = Settings(settings_module)
14:20:07 celeryd.1  |     self._setup()
14:20:07 web.1      |   File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/utils/functional.py", line 184, in inner
14:20:07 worker.1   |   File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/conf/__init__.py", line 93, in __init__
14:20:07 celeryd.1  |   File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/conf/__init__.py", line 42, in _setup
14:20:07 web.1      |     self._setup()
14:20:07 worker.1   |     mod = importlib.import_module(self.SETTINGS_MODULE)
14:20:07 celeryd.1  |     self._wrapped = Settings(settings_module)
14:20:07 web.1      |   File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/conf/__init__.py", line 42, in _setup
14:20:07 worker.1   |   File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/utils/importlib.py", line 35, in import_module
14:20:07 celeryd.1  |   File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/conf/__init__.py", line 93, in __init__
14:20:07 web.1      |     self._wrapped = Settings(settings_module)
14:20:07 worker.1   |     __import__(name)
14:20:07 celeryd.1  |     mod = importlib.import_module(self.SETTINGS_MODULE)
14:20:07 web.1      |   File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/conf/__init__.py", line 93, in __init__
14:20:07 worker.1   |   File "/Users/allard/Projects/hellolily/lily/__init__.py", line 10, in <module>
14:20:07 celeryd.1  |   File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/utils/importlib.py", line 35, in import_module
14:20:07 web.1      |     mod = importlib.import_module(self.SETTINGS_MODULE)
14:20:07 worker.1   |     from django.forms.forms import BaseForm
14:20:07 celeryd.1  |     __import__(name)
14:20:07 web.1      |   File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/utils/importlib.py", line 35, in import_module
14:20:07 worker.1   |   File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/forms/__init__.py", line 16, in <module>
14:20:07 celeryd.1  |   File "/Users/allard/Projects/hellolily/lily/__init__.py", line 10, in <module>
14:20:07 web.1      |     __import__(name)
14:20:07 worker.1   |     from django.forms.fields import *
14:20:07 celeryd.1  |     from django.forms.forms import BaseForm
14:20:07 web.1      |   File "/Users/allard/Projects/hellolily/lily/__init__.py", line 10, in <module>
14:20:07 worker.1   |   File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/forms/fields.py", line 18, in <module>
14:20:07 celeryd.1  |   File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/forms/__init__.py", line 16, in <module>
14:20:07 web.1      |     from django.forms.forms import BaseForm
14:20:07 worker.1   |     from django.core import validators
14:20:07 celeryd.1  |     from django.forms.fields import *
14:20:07 web.1      |   File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/forms/__init__.py", line 16, in <module>
14:20:07 worker.1   |   File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/core/validators.py", line 17, in <module>
14:20:07 celeryd.1  |   File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/forms/fields.py", line 18, in <module>
14:20:07 web.1      |     from django.forms.fields import *
14:20:07 worker.1   |     URL_VALIDATOR_USER_AGENT = settings.URL_VALIDATOR_USER_AGENT
14:20:07 celeryd.1  |     from django.core import validators
14:20:07 web.1      |   File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/forms/fields.py", line 18, in <module>
14:20:07 worker.1   |   File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/utils/functional.py", line 184, in inner
14:20:07 celeryd.1  |   File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/core/validators.py", line 17, in <module>
14:20:07 web.1      |     from django.core import validators
14:20:07 worker.1   |     self._setup()
14:20:07 celeryd.1  |     URL_VALIDATOR_USER_AGENT = settings.URL_VALIDATOR_USER_AGENT
14:20:07 web.1      |   File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/core/validators.py", line 17, in <module>
14:20:07 worker.1   |   File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/conf/__init__.py", line 42, in _setup
14:20:07 celeryd.1  |   File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/utils/functional.py", line 184, in inner
14:20:07 web.1      |     URL_VALIDATOR_USER_AGENT = settings.URL_VALIDATOR_USER_AGENT
14:20:07 worker.1   |     self._wrapped = Settings(settings_module)
14:20:07 celeryd.1  |     self._setup()
14:20:07 web.1      |   File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/utils/functional.py", line 184, in inner
14:20:07 worker.1   |   File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/conf/__init__.py", line 93, in __init__
14:20:07 celeryd.1  |   File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/conf/__init__.py", line 42, in _setup
14:20:07 web.1      |     self._setup()
14:20:07 worker.1   |     mod = importlib.import_module(self.SETTINGS_MODULE)
14:20:07 celeryd.1  |     self._wrapped = Settings(settings_module)
14:20:07 web.1      |   File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/conf/__init__.py", line 42, in _setup
14:20:07 worker.1   |   File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/utils/importlib.py", line 35, in import_module
14:20:07 celeryd.1  |   File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/conf/__init__.py", line 93, in __init__
14:20:07 web.1      |     self._wrapped = Settings(settings_module)
14:20:07 worker.1   |     __import__(name)
14:20:07 celeryd.1  |     mod = importlib.import_module(self.SETTINGS_MODULE)
14:20:07 web.1      |   File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/conf/__init__.py", line 93, in __init__
14:20:07 worker.1   |   File "/Users/allard/Projects/hellolily/lily/settings.py", line 53, in <module>
14:20:07 celeryd.1  |   File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/utils/importlib.py", line 35, in import_module
14:20:07 web.1      |     mod = importlib.import_module(self.SETTINGS_MODULE)
14:20:07 worker.1   |     ('nl', gettext_noop('Dutch')),
14:20:07 celeryd.1  |     __import__(name)
14:20:07 web.1      |   File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/utils/importlib.py", line 35, in import_module
14:20:07 worker.1   |   File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/utils/translation/__init__.py", line 75, in gettext_noop
14:20:07 celeryd.1  |   File "/Users/allard/Projects/hellolily/lily/settings.py", line 53, in <module>
14:20:07 web.1      |     __import__(name)
14:20:07 celeryd.1  |     ('nl', gettext_noop('Dutch')),
14:20:07 web.1      |   File "/Users/allard/Projects/hellolily/lily/settings.py", line 53, in <module>
14:20:07 celeryd.1  |   File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/utils/translation/__init__.py", line 75, in gettext_noop
14:20:07 web.1      |     ('nl', gettext_noop('Dutch')),
14:20:07 web.1      |   File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/utils/translation/__init__.py", line 75, in gettext_noop
14:20:07 celeryd.1  |     return _trans.gettext_noop(message)
14:20:07 web.1      |     return _trans.gettext_noop(message)
14:20:07 worker.1   |     return _trans.gettext_noop(message)
14:20:07 celeryd.1  |   File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/utils/translation/__init__.py", line 48, in __getattr__
14:20:07 web.1      |   File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/utils/translation/__init__.py", line 48, in __getattr__
14:20:07 worker.1   |   File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/utils/translation/__init__.py", line 48, in __getattr__
14:20:07 celeryd.1  |     if settings.USE_I18N:
14:20:07 web.1      |     if settings.USE_I18N:
14:20:07 worker.1   |     if settings.USE_I18N:
14:20:07 celeryd.1  |   File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/utils/functional.py", line 184, in inner
14:20:07 web.1      |   File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/utils/functional.py", line 184, in inner
14:20:07 worker.1   |   File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/utils/functional.py", line 184, in inner
14:20:07 celeryd.1  |     self._setup()
14:20:07 web.1      |     self._setup()
14:20:07 worker.1   |     self._setup()
14:20:07 celeryd.1  |   File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/conf/__init__.py", line 42, in _setup
14:20:07 web.1      |   File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/conf/__init__.py", line 42, in _setup
14:20:07 worker.1   |   File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/conf/__init__.py", line 42, in _setup
14:20:07 celeryd.1  |     self._wrapped = Settings(settings_module)
14:20:07 web.1      |     self._wrapped = Settings(settings_module)
14:20:07 worker.1   |     self._wrapped = Settings(settings_module)
14:20:07 celeryd.1  |   File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/conf/__init__.py", line 118, in __init__
14:20:07 web.1      |   File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/conf/__init__.py", line 118, in __init__
14:20:07 worker.1   |   File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/conf/__init__.py", line 118, in __init__
14:20:07 celeryd.1  |     raise ValueError("Incorrect timezone setting: %s" % self.TIME_ZONE)
14:20:07 web.1      |     raise ValueError("Incorrect timezone setting: %s" % self.TIME_ZONE)
14:20:07 worker.1   |     raise ValueError("Incorrect timezone setting: %s" % self.TIME_ZONE)
14:20:07 celeryd.1  | ValueError: Incorrect timezone setting: Europe/Amsterdam
14:20:07 web.1      | ValueError: Incorrect timezone setting: Europe/Amsterdam
14:20:07 worker.1   | ValueError: Incorrect timezone setting: Europe/Amsterdam
14:20:07 worker.1   | process terminated

粘贴到〜/ .virtualenvs / env_name / lib / python2.7 / site-packages / pytz / zoneinfo:

When pasted into ~/.virtualenvs/env_name/lib/python2.7/site-packages/pytz/zoneinfo:

15:31:18 celeryd.1  | [2013-03-01 15:31:18,179: WARNING/Beat] Process Beat:
15:31:18 celeryd.1  | [2013-03-01 15:31:18,180: WARNING/Beat] Traceback (most recent call last):
15:31:18 celeryd.1  | [2013-03-01 15:31:18,180: WARNING/Beat] File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/billiard/process.py", line 273, in _bootstrap
15:31:18 celeryd.1  | [2013-03-01 15:31:18,180: WARNING/Beat] self.run()
15:31:18 celeryd.1  | [2013-03-01 15:31:18,181: WARNING/Beat] File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/celery/beat.py", line 472, in run
15:31:18 celeryd.1  | [2013-03-01 15:31:18,181: WARNING/Beat] self.service.start(embedded_process=True)
15:31:18 celeryd.1  | [2013-03-01 15:31:18,181: WARNING/Beat] File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/celery/beat.py", line 401, in start
15:31:18 celeryd.1  | [2013-03-01 15:31:18,181: WARNING/Beat] humanize_seconds(self.scheduler.max_interval))
15:31:18 celeryd.1  | [2013-03-01 15:31:18,182: WARNING/Beat] File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/kombu/utils/__init__.py", line 234, in __get__
15:31:18 celeryd.1  | [2013-03-01 15:31:18,182: WARNING/Beat] value = obj.__dict__[self.__name__] = self.__get(obj)
15:31:18 celeryd.1  | [2013-03-01 15:31:18,182: WARNING/Beat] File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/celery/beat.py", line 439, in scheduler
15:31:18 celeryd.1  | [2013-03-01 15:31:18,182: WARNING/Beat] return self.get_scheduler()
15:31:18 celeryd.1  | [2013-03-01 15:31:18,183: WARNING/Beat] File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/celery/beat.py", line 434, in get_scheduler
15:31:18 celeryd.1  | [2013-03-01 15:31:18,183: WARNING/Beat] lazy=lazy)
15:31:18 celeryd.1  | [2013-03-01 15:31:18,183: WARNING/Beat] File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/celery/utils/imports.py", line 51, in instantiate
15:31:18 celeryd.1  | [2013-03-01 15:31:18,183: WARNING/MainProcess] celery@Allards-MacBook-Pro.local has started.
15:31:18 celeryd.1  | [2013-03-01 15:31:18,183: WARNING/Beat] return symbol_by_name(name)(*args, **kwargs)
15:31:18 celeryd.1  | [2013-03-01 15:31:18,184: WARNING/Beat] File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/djcelery/schedulers.py", line 124, in __init__
15:31:18 celeryd.1  | [2013-03-01 15:31:18,184: WARNING/Beat] Scheduler.__init__(self, *args, **kwargs)
15:31:18 celeryd.1  | [2013-03-01 15:31:18,184: WARNING/Beat] File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/celery/beat.py", line 158, in __init__
15:31:18 celeryd.1  | [2013-03-01 15:31:18,184: WARNING/Beat] self.setup_schedule()
15:31:18 celeryd.1  | [2013-03-01 15:31:18,185: WARNING/Beat] File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/djcelery/schedulers.py", line 130, in setup_schedule
15:31:18 celeryd.1  | [2013-03-01 15:31:18,185: WARNING/Beat] self.install_default_entries(self.schedule)
15:31:18 celeryd.1  | [2013-03-01 15:31:18,185: WARNING/Beat] File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/djcelery/schedulers.py", line 216, in schedule
15:31:18 celeryd.1  | [2013-03-01 15:31:18,185: WARNING/Beat] if self.schedule_changed():
15:31:18 celeryd.1  | [2013-03-01 15:31:18,185: WARNING/Beat] File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/djcelery/schedulers.py", line 161, in schedule_changed
15:31:18 celeryd.1  | [2013-03-01 15:31:18,186: WARNING/Beat] self._last_timestamp = now()
15:31:18 celeryd.1  | [2013-03-01 15:31:18,186: WARNING/Beat] File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/djcelery/utils.py", line 65, in now
15:31:18 celeryd.1  | [2013-03-01 15:31:18,186: WARNING/Beat] return timezone.localtime(timezone.now())
15:31:18 celeryd.1  | [2013-03-01 15:31:18,186: WARNING/Beat] File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/utils/timezone.py", line 222, in localtime
15:31:18 celeryd.1  | [2013-03-01 15:31:18,187: WARNING/Beat] timezone = get_current_timezone()
15:31:18 celeryd.1  | [2013-03-01 15:31:18,187: WARNING/Beat] File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/utils/timezone.py", line 130, in get_current_timezone
15:31:18 celeryd.1  | [2013-03-01 15:31:18,187: WARNING/Beat] return getattr(_active, "value", get_default_timezone())
15:31:18 celeryd.1  | [2013-03-01 15:31:18,187: WARNING/Beat] File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/django/utils/timezone.py", line 112, in get_default_timezone
15:31:18 celeryd.1  | [2013-03-01 15:31:18,188: WARNING/Beat] _localtime = pytz.timezone(settings.TIME_ZONE)
15:31:18 celeryd.1  | [2013-03-01 15:31:18,188: WARNING/Beat] File "/Users/allard/.virtualenvs/hellolily/lib/python2.7/site-packages/pytz/__init__.py", line 185, in timezone
15:31:18 celeryd.1  | [2013-03-01 15:31:18,188: WARNING/Beat] raise UnknownTimeZoneError(zone)
15:31:18 celeryd.1  | [2013-03-01 15:31:18,188: WARNING/Beat] UnknownTimeZoneError: 'Europe/Amsterdam'

所以看起来提供的zoneinfo数据是不正确/不完整的。我在哪里可以得到正确的数据?

So it seems the zoneinfo data provided is incorrect/incomplete. Where do I get the correct data?

编辑2:

Burhan Khalid的答案是答案,即使对我来说,这并不奏效。我这样做是因为我确信我做错了,答案是正确的。我如何解决这个问题,只需将另一个macbook的zoneinfo数据复制到这个。

I marked Burhan Khalid's answer as the answer even though for me it did not work. I did this because I am sure I did something wrong and the answer is correct. How I fixed this problem is simply by copy pasting the zoneinfo data from another macbook to this one.

推荐答案

看起来你的 zoneinfo 数据库已损坏。下载最新更新,并将存档扩展为 / usr / share / zoneinfo /

Seems your zoneinfo database is corrupted. Download the latest update and expand the archive into /usr/share/zoneinfo/.

要更新数据库,下载数据后,您需要运行 zic (区域信息编译器),由于您将更新系统区域文件,您需要使用 sudo

To update your database, once you download the data you need to run zic (zone info compiler), and since you'll be updating the system zone files, you need to run it with sudo:

tar xvzf tzdata2012j.tar.gz

然后创建这个小脚本:

#!/bin/bash

ZONES="africa
antartica
asia
australasia
europe
northamerica
pacificnew
solar87
solar88
solar89
southamerica"

for i in $ZONES
   do zic $i
done

然后从扩展档案的目录中的 sudo ./the_script.sh 运行。

Then run it with sudo ./the_script.sh from the directory where you expanded the archive.

这篇关于Django芹菜在启动时击败了pytz错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆