我目前正在尝试设置一个名为Flower的Python监视工具,以检查是否已成功处理任务。当前,这是我的设置,如下所示:
当我通过命令行开始开花时
flower -A celery_app --broker='redis://:PASSWORD@redis-endpoint:6379/2' --broker_api='redis://:PASSWORD@redis-endpoint:6379/2'
我收到以下错误:
dbm.error: db type is dbm.gnu, but the module is not available
完整错误消息:
> flower -> flower:0.9.3 tornado:5.1.1 babel:2.5.0
> software -> celery:4.3.0 (rhubarb) kombu:4.6.3 py:3.6.7
> billiard:3.6.0.0 redis:3.3.6
> platform -> system:Linux arch:64bit
> kernel version:4.15.0-1044-aws imp:CPython
> loader -> celery.loaders.app.AppLoader
> settings -> transport:redis results:disabled
>
>
>
> Traceback (most recent call last):
> File "/dir/venv/bin/flower", line 10, in <module>
> sys.exit(main())
> File "/dir/venv/lib/python3.6/site-packages/flower/__main__.py",
> line 11, in main
> flower.execute_from_commandline()
> File "/dir/venv/lib/python3.6/site-packages/celery/bin/base.py",
> line 298, in execute_from_commandline
> return self.handle_argv(self.prog_name, argv[1:])
> File "/dir/venv/lib/python3.6/site-packages/flower/command.py",
> line 56, in handle_argv
> return self.run_from_argv(prog_name, argv)
> File "/dir/venv/lib/python3.6/site-packages/flower/command.py",
> line 40, in run_from_argv
> flower = Flower(capp=self.app, options=options, **settings)
> File "/dir/venv/lib/python3.6/site-packages/flower/app.py",
> line 42, in __init__
> max_tasks_in_memory=self.options.max_tasks)
> File "/dir/venv/lib/python3.6/site-packages/flower/events.py",
> line 79, in __init__
> state = shelve.open(self.db)
> File "/dir/.pyenv/versions/3.6.7/lib/python3.6/shelve.py", line 243,
> in open
> return DbfilenameShelf(filename, flag, protocol, writeback)
> File "/dir/.pyenv/versions/3.6.7/lib/python3.6/shelve.py", line 227,
> in __init__
> Shelf.__init__(self, dbm.open(filename, flag), protocol, writeback)
> File "/dir/.pyenv/versions/3.6.7/lib/python3.6/dbm/__init__.py",
> line 91, in open
> "available".format(result))
> dbm.error: db type is dbm.gnu, but the module is not available
我也尝试安装sudo apt-get python3-gdbm
,但对我的问题没有帮助。
答案 0 :(得分:1)
以防其他人遇到此错误。 这是pyenv的问题。即使之后
sudo apt-get install python3-gdbm
该库将安装在系统中,但不会安装在 pyenv 中。 所以这里描述的解决方案:
GDBM doesn't work with Python 3.6 and anaconda
pyenv 的步骤相同。