启动花时,我得到以下信息:“dbm.error: db type is dbm.gnu, but the module is not available"; [英] When starting flower, I get the following: "dbm.error: db type is dbm.gnu, but the module is not available"

查看:259
本文介绍了启动花时,我得到以下信息:“dbm.error: db type is dbm.gnu, but the module is not available";的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在尝试设置一个名为 Flower 的 Python 监控工具,以检查任务是否正在成功处理.目前这是我的设置如下:

I am currently trying to setup a Python monitoring tool, called Flower, to check whether tasks are being successfully processed. Currently this is my setup is as follows:

  • ubuntu 18.04.2 LTS (GNU/Linux 4.15.0-1044-aws x86_64)
  • python 3.6.7
  • 芹菜 4.3.0
  • 花 0.9.3
  • redis 5.0.5(芹菜代理)

当我通过命令行启动花时

When I start flower via the command line

flower -A celery_app --broker='redis://:PASSWORD@redis-endpoint:6379/2' --broker_api='redis://:PASSWORD@redis-endpoint:6379/2'

我收到以下错误:dbm.error: db type 是 dbm.gnu,但是模块不可用

完整的错误信息:

>     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 但它对我的问题没有帮助.

I also tried installing sudo apt-get python3-gdbm but it did not help with my problem.

推荐答案

以防其他人遇到此错误.这是pyenv的问题.即使之后

In case someone else face this error. It is problem with pyenv. Even after

sudo apt-get install python3-gdbm

该库将安装在系统中,但不会安装在 pyenv 中.所以这里描述的解决方案:

the library will be installed in the system, but not in the pyenv. So the solution described here:

GDBM 不适用于 Python 3.6 和 anaconda

pyenv 的步骤相同.

The steps will be the same for pyenv.

这篇关于启动花时,我得到以下信息:“dbm.error: db type is dbm.gnu, but the module is not available";的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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