加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > Python > 正文

macos – 芹菜不在OS X中启动 – dbm.error:db类型是dbm.gnu,但

发布时间:2020-12-20 13:44:36 所属栏目:Python 来源:网络整理
导读:我正试图在OS X(Mavericks)中运行芹菜工人.我激活了虚拟环境( python 3.4)并试图用这个参数启动Celery: celery worker --app=scheduling -linfo 调度是我的芹菜应用程序. 但我最终得到了这个错误:dbm.error:db类型是dbm.gnu,但模块不可用 完成堆栈跟踪:
我正试图在OS X(Mavericks)中运行芹菜工人.我激活了虚拟环境( python 3.4)并试图用这个参数启动Celery:

celery worker --app=scheduling -linfo

调度是我的芹菜应用程序.

但我最终得到了这个错误:dbm.error:db类型是dbm.gnu,但模块不可用

完成堆栈跟踪:

Traceback (most recent call last):
  File "/Users/other/PhoenixEnv/lib/python3.4/site-packages/kombu/utils/__init__.py",line 320,in __get__
    return obj.__dict__[self.__name__]
KeyError: 'db'

During handling of the above exception,another exception occurred:

Traceback (most recent call last):
  File "/Users/other/PhoenixEnv/bin/celery",line 9,in <module>
    load_entry_point('celery==3.1.9','console_scripts','celery')()
  File "/Users/other/PhoenixEnv/lib/python3.4/site-packages/celery/__main__.py",line 30,in main
    main()
  File "/Users/other/PhoenixEnv/lib/python3.4/site-packages/celery/bin/celery.py",line 80,in main
    cmd.execute_from_commandline(argv)
  File "/Users/other/PhoenixEnv/lib/python3.4/site-packages/celery/bin/celery.py",line 768,in execute_from_commandline
    super(CeleryCommand,self).execute_from_commandline(argv)))
  File "/Users/other/PhoenixEnv/lib/python3.4/site-packages/celery/bin/base.py",line 308,in execute_from_commandline
    return self.handle_argv(self.prog_name,argv[1:])
  File "/Users/other/PhoenixEnv/lib/python3.4/site-packages/celery/bin/celery.py",line 760,in handle_argv
    return self.execute(command,argv)
  File "/Users/other/PhoenixEnv/lib/python3.4/site-packages/celery/bin/celery.py",line 692,in execute
    ).run_from_argv(self.prog_name,argv[1:],command=argv[0])
  File "/Users/other/PhoenixEnv/lib/python3.4/site-packages/celery/bin/worker.py",line 175,in run_from_argv
    return self(*args,**options)
  File "/Users/other/PhoenixEnv/lib/python3.4/site-packages/celery/bin/base.py",line 271,in __call__
    ret = self.run(*args,**kwargs)
  File "/Users/other/PhoenixEnv/lib/python3.4/site-packages/celery/bin/worker.py",line 209,in run
    ).start()
  File "/Users/other/PhoenixEnv/lib/python3.4/site-packages/celery/worker/__init__.py",line 100,in __init__
    self.setup_instance(**self.prepare_args(**kwargs))
  File "/Users/other/PhoenixEnv/lib/python3.4/site-packages/celery/worker/__init__.py",line 141,in setup_instance
    self.blueprint.apply(self,**kwargs)
  File "/Users/other/PhoenixEnv/lib/python3.4/site-packages/celery/bootsteps.py",line 221,in apply
    step.include(parent)
  File "/Users/other/PhoenixEnv/lib/python3.4/site-packages/celery/bootsteps.py",line 347,in include
    return self._should_include(parent)[0]
  File "/Users/other/PhoenixEnv/lib/python3.4/site-packages/celery/bootsteps.py",line 343,in _should_include
    return True,self.create(parent)
  File "/Users/other/PhoenixEnv/lib/python3.4/site-packages/celery/worker/components.py",line 220,in create
    w._persistence = w.state.Persistent(w.state,w.state_db,w.app.clock)
  File "/Users/other/PhoenixEnv/lib/python3.4/site-packages/celery/worker/state.py",line 161,in __init__
    self.merge()
  File "/Users/other/PhoenixEnv/lib/python3.4/site-packages/celery/worker/state.py",line 169,in merge
    self._merge_with(self.db)
  File "/Users/other/PhoenixEnv/lib/python3.4/site-packages/kombu/utils/__init__.py",line 322,in __get__
    value = obj.__dict__[self.__name__] = self.__get(obj)
  File "/Users/other/PhoenixEnv/lib/python3.4/site-packages/celery/worker/state.py",line 238,in db
    return self.open()
  File "/Users/other/PhoenixEnv/lib/python3.4/site-packages/celery/worker/state.py",line 165,in open
    self.filename,protocol=self.protocol,writeback=True,File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/shelve.py",line 239,in open
    return DbfilenameShelf(filename,flag,protocol,writeback)
  File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/shelve.py",line 223,in __init__
    Shelf.__init__(self,dbm.open(filename,flag),writeback)
  File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/dbm/__init__.py",line 91,in open
    "available".format(result))
dbm.error: db type is dbm.gnu,but the module is not available

请帮忙.

解决方法

我切换到python3.5并得到了同样的错误.在Ubuntu上,我可以解决它

aptitude install python3.5-gdbm

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读