current position:Home>How to solve termux qqbot error?

How to solve termux qqbot error?

2022-02-02 17:01:55 CSDN Q & A

The last line :
AttributeError: 'HTMLParser' object has no attribute 'unescape'
Version information :
termux 0.117
MIUI: 12.5.7
python 3.10.0
qqbot 2.3.11
The complete error information is as follows :

Traceback (most recent call last):  File "/data/data/com.termux/files/usr/bin/qqbot", line 33, in <module>    sys.exit(load_entry_point('qqbot==2.3.11', 'console_scripts', 'qqbot')())  File "/data/data/com.termux/files/usr/bin/qqbot", line 25, in importlib_load_entry_point    return next(matches).load()  File "/data/data/com.termux/files/usr/lib/python3.10/importlib/metadata/__init__.py", line 162, in load    module = import_module(match.group('module'))  File "/data/data/com.termux/files/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module    return _bootstrap._gcd_import(name[level:], package, level)  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked  File "<frozen importlib._bootstrap_external>", line 883, in exec_module  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed  File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/qqbot/__init__.py", line 3, in <module>    from .qqbotcls import QQBot, QQBotSlot, QQBotSched, RunBot, _bot  File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/qqbot/qqbotcls.py", line 20, in <module>    from qqbot.qconf import QConf  File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/qqbot/qconf.py", line 198, in <module>    from qqbot.utf8logger import SetLogLevel, INFO, RAWINPUT, PRINT, ERROR  File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/qqbot/utf8logger.py", line 10, in <module>    from qqbot.common import PY3  File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/qqbot/common.py", line 184, in <module>    import html.parser; htmlUnescape = html.parser.HTMLParser().unescapeAttributeError: 'HTMLParser' object has no attribute 'unescape'



Refer to the answer 1:

The definition of the library has changed . Modify the usage

img

    import html.parser; htmlUnescape = html.parser.HTMLParser().unescap

Change to

import html.parserhtmlUnescape = html.unescape



Refer to the answer 2:

copyright notice
author[CSDN Q & A],Please bring the original link to reprint, thank you.
https://en.primo.wiki/2022/02/202202021701537349.html

Random recommended