Replies: 1 comment 3 replies
-
你可以降级虚拟环境里的pydantic版本至v1: pip install --force-reinstall 'pydantic~=1.10' |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
新创建的机器人项目,适配器只添加了mirai2,驱动器添加了FastAPI,HTTPX和websockets
运行nb run报错如下
(nonebot) root@RainYun-J5aZg9Mo:~/nonebot-amiya# nb run
Using python: /root/nonebot-amiya/.venv/bin/python
Traceback (most recent call last):
File "", line 2, in
File "/root/nonebot-amiya/.venv/lib/python3.12/site-packages/nonebot/adapters/mirai2/init.py", line 1, in
from .bot import Bot
File "/root/nonebot-amiya/.venv/lib/python3.12/site-packages/nonebot/adapters/mirai2/bot.py", line 6, in
from .event.message import FriendMessage, GroupMessage, TempMessage
File "/root/nonebot-amiya/.venv/lib/python3.12/site-packages/nonebot/adapters/mirai2/event/init.py", line 10, in
from .message import * # noqa
^^^^^^^^^^^^^^^^^^^^^^
File "/root/nonebot-amiya/.venv/lib/python3.12/site-packages/nonebot/adapters/mirai2/event/message.py", line 23, in
class MessageQuote(BaseModel):
File "/root/nonebot-amiya/.venv/lib/python3.12/site-packages/pydantic/_internal/_model_construction.py", line 92, in new
private_attributes = inspect_namespace(
^^^^^^^^^^^^^^^^^^
File "/root/nonebot-amiya/.venv/lib/python3.12/site-packages/pydantic/_internal/_model_construction.py", line 359, in inspect_namespace
raise NameError(
NameError: Fields must not use names with leading underscores; e.g., use 'type' instead of '_type'.
请问怎么处理。
Beta Was this translation helpful? Give feedback.
All reactions