(zhenxun-bot-py3.10) G:\bot\zhenxun\zhenxun_bot>python bot.py C:\Users\Straw\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot--J5vPfcz-py3.10\lib\site-packages\pydantic\_migration.py:283: UserWarning:pydantic.generics:GenericModelhas been moved topydantic.BaseModel. warnings.warn(f'{import_path}has been moved to{new_location}`.')
C:\Users\Straw\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot--J5vPfcz-py3.10\lib\site-packages\pydantic_internal_config.py:341: UserWarning: Valid config keys have changed in V2:
'allow_population_by_field_name' has been renamed to 'populate_by_name'
warnings.warn(message, UserWarning)
09-06 07:08:20 [SUCCESS] nonebot | NoneBot is initializing...
Traceback (most recent call last):
File "G:\bot\zhenxun\zhenxun_bot\bot.py", line 8, in
nonebot.init()
File "C:\Users\Straw\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot--J5vPfcz-py3.10\lib\site-packages\nonebot__init.py", line 299, in init
config = Config(
File "C:\Users\Straw\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot--J5vPfcz-py3.10\lib\site-packages\nonebot\config.py", line 333, in init
super().init(
File "C:\Users\Straw\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot--J5vPfcz-py3.10\lib\site-packages\pydantic\main.py", line 193, in init
self.pydantic_validator__.validate_python(data, self_instance=self)
pydantic_core._pydantic_core.ValidationError: 1 validation error for Config
session_expire_timeout
Input should be a valid timedelta, "day" identifier in duration not correctly formatted [type=time_delta_parsing, input_value='30', input_type=str]
For further information visit https://errors.pydantic.dev/2.8/v/time_delta_parsing`
截图报错:
版本为0.2.2最新release版本,python版本为3.10.6,电脑系统为Win11 23H2
请问如何修改文件以解决此报错问题?
(zhenxun-bot-py3.10) G:\bot\zhenxun\zhenxun_bot>python bot.py C:\Users\Straw\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot--J5vPfcz-py3.10\lib\site-packages\pydantic\_migration.py:283: UserWarning:
pydantic.generics:GenericModelhas been moved to
pydantic.BaseModel. warnings.warn(f'
{import_path}has been moved to
{new_location}`.') C:\Users\Straw\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot--J5vPfcz-py3.10\lib\site-packages\pydantic_internal_config.py:341: UserWarning: Valid config keys have changed in V2: