Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Celery not starting in OS X - dbm.error: db type is dbm.gnu, but the module is not available

I'm trying to run celery worker in OS X (Mavericks). I activated virtual environment (python 3.4) and tried to start Celery with this argument:

celery worker --app=scheduling -linfo

Where scheduling is my celery app.

But I ended up with this error: dbm.error: db type is dbm.gnu, but the module is not available

Complete stacktrace:

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), protocol, 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

Please help.

like image 473
Shafiul Avatar asked Oct 31 '22 17:10

Shafiul


2 Answers

I switched to python3.5 and got the same error. On Ubuntu I could fix it with

aptitude install python3.5-gdbm
like image 91
MrJ Avatar answered Nov 13 '22 04:11

MrJ


I got the same error. On Macbook I could fix it with

brew install gdb
like image 27
wangchenxi Avatar answered Nov 13 '22 02:11

wangchenxi