python-wechaty-getting-started icon indicating copy to clipboard operation
python-wechaty-getting-started copied to clipboard

我在CentOS 8.3.2011上按照文档导入了wechaty后,执行python examples/ding-dong-bot.py时有以下报错,请求帮助!

Open sunyidi123 opened this issue 4 years ago • 6 comments

[root@localhost python-wechaty-getting-started]# python examples/ding-dong-bot.py Traceback (most recent call last): File "/home/app/python-wechaty-getting-started/examples/ding-dong-bot.py", line 19, in from wechaty import ( File "/usr/local/lib/python3.9/site-packages/wechaty/init.py", line 44, in from .config import ( File "/usr/local/lib/python3.9/site-packages/wechaty/config.py", line 34, in log = get_logger('Config') File "/usr/local/lib/python3.9/site-packages/wechaty_puppet/logger.py", line 66, in get_logger console_handler.setLevel(WECHATY_LOG) File "/usr/local/lib/python3.9/logging/init.py", line 910, in setLevel self.level = _checkLevel(level) File "/usr/local/lib/python3.9/logging/init.py", line 194, in _checkLevel raise ValueError("Unknown level: %r" % level) ValueError: Unknown level: 'verbose'

image

sunyidi123 avatar Apr 02 '21 03:04 sunyidi123

可以试一下: export WECHATY_LOG=INFO 然后再执行: python3 examples/ding-dong-bot.py

xiao198304 avatar Apr 04 '21 04:04 xiao198304

According to our Wechaty Specification https://wechaty.js.org/docs/specs/wechaty:

The WECHATY_LOG should support the values of silly, verbose, info, warn, silent

All Polyglot Wechaty should at least support the above names as an alias.

Link to https://github.com/wechaty/wechaty/issues/2167

CC @wechaty/python @wechaty/go @wechaty/java @wechaty/php @wechaty/dotnet @wechaty/scala @wechaty/rust

huan avatar Apr 04 '21 09:04 huan

@xiao198304 @huan 谢谢帮助。 但在执行了export WECHATY_LOG=INFO后,执行python3 examples/ding-dong-bot.py时又出现了新的如下报错。 image 我是否遗漏了什么组件或者步骤没有配置?

sunyidi123 avatar Apr 05 '21 02:04 sunyidi123

Please check your token settings.

See:

  1. https://wechaty.js.org/docs/specs/token/
  2. https://wechaty.js.org/docs/puppet-services/

huan avatar Apr 07 '21 03:04 huan

@xiao198304 @huan 谢谢帮助。 但在执行了export WECHATY_LOG=INFO后,执行python3 examples/ding-dong-bot.py时又出现了新的如下报错。 image 我是否遗漏了什么组件或者步骤没有配置?

同问!!!

livingbody avatar Aug 03 '21 17:08 livingbody

Bug: Service server is invalid belongs to configuration error. @livingbody you can read the doc of python-wechaty to start bot. Hope that can help you.

wj-Mcat avatar Aug 04 '21 12:08 wj-Mcat