Closed bowen99 closed 1 year ago
哪个插件?
[nonebot_plugin_setu_customization] 会卸载pydantic 有安装权限问题 然后启动的时候提示mportError: cannot import name 'DotenvType' from 'pydantic.env_settings' ,nb命令失效 需要重新安装python才可以
还会卸载pydantic?我的pyproject.toml文件里都没提到它
Installing collected packages: pytz, python-socks, ujson, tzdata, soupsieve, pydantic, Pillow, uvicorn, starlette, pytz-deprecation-shim, beautifulsoup4, tzlocal, fastapi, nonebot2, httpx-socks, apscheduler, nonebot-plugin -setu-customization Attempting uninstall: pydantic Found existing installation: pydantic 1.10.4 Uninstalling pydantic-1.10.4: Successfully uninstalled pydantic-1.10.4 ERROR: Could not install packages due to an OSError: [WinError 5] 存取被拒。: 'E:\ceshi\venv\Lib\site-packages\~ydantic\annotated_types.cp39-win_amd64.pyd' Check the permissions.
(venv) E:\ceshi>nb
Traceback (most recent call last):
File "C:\Users\bowen_wang\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Users\bowen_wang\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 87, in _run_code
exec(code, run_globals)
File "E:\ceshi\venv\Scripts\nb.exe__main__.py", line 4, in
就是这种情况 纯环境 什么插件都没装的那种 还是会有这种情况
你是用什么命令安装的,我复现一下
nb plugin install
我全局python和虚拟环境python都测试过没问题,都是新建bot测试的,python版本3.10 不过有一个依赖没加上,jinjia2的包,已经更新了。 你这个pydantic倒是没复现成功。
我之前忽略了有些特性是3.10才有的,你之前用的3.9,不知道有没有影响,你可以再试试安装,现在已经兼容3.8了
ImportError: cannot import name 'DotenvType' from 'pydantic.env_settings' (E:\mybots\venv\lib\site-packages\pydantic\env_settings.cp39-win_amd64.pyd)