You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
按照步骤安装,没有任何错误,运行时 python web.py
报如下错误,是我哪里做错了吗:PydanticImportError:
pydantic:parse_raw_as
has been removed in V2.详细过程
(python31011) D:\ai\MockingBird-main\MockingBird-main>python web.py
┌─────────────────────────────── Traceback (most recent call last) ────────────────────────────────┐
│ D:\ai\MockingBird-main\MockingBird-main\web.py:17 in launch │
│ │
│ 14 │ # This is required to resolve the opyrator path │
│ 15 │ sys.path.append(os.getcwd()) │
│ 16 │ │
│ > 17 │ from control.mkgui.base.ui.streamlit_ui import launch_ui │
│ 18 │ launch_ui(port) │
│ 19 │
│ 20 if name == "main": │
│ │
│ ┌── locals ───┐ │
│ │ port = 8080 │ │
│ └─────────────┘ │
│ │
│ D:\ai\MockingBird-main\MockingBird-main\control\mkgui\base_init_.py:2 in │
│ │
│ 1 │
│ > 2 from .core import Opyrator │
│ 3 │
│ │
│ D:\ai\MockingBird-main\MockingBird-main\control\mkgui\base\core.py:6 in │
│ │
│ 3 import re │
│ 4 from typing import Any, Callable, Type, Union, get_type_hints │
│ 5 │
│ > 6 from pydantic import BaseModel, parse_raw_as │
│ 7 from pydantic.tools import parse_obj_as │
│ 8 │
│ 9 │
│ │
│ ┌─────────────────────────────────────────── locals ───────────────────────────────────────────┐ │
│ │ Any = typing.Any │ │
│ │ Callable = typing.Callable │ │
│ │ get_type_hints = <function get_type_hints at 0x000001C682ADB9A0> │ │
│ │ importlib = <module 'importlib' from │ │
│ │ 'D:\server\anaconda3\envs\python31011\lib\importlib\init.py'> │ │
│ │ inspect = <module 'inspect' from │ │
│ │ 'D:\server\anaconda3\envs\python31011\lib\inspect.py'> │ │
│ │ re = <module 're' from 'D:\server\anaconda3\envs\python31011\lib\re.py'> │ │
│ │ Type = typing.Type │ │
│ │ Union = typing.Union │ │
│ └──────────────────────────────────────────────────────────────────────────────────────────────┘ │
│ │
│ D:\server\anaconda3\envs\python31011\lib\site-packages\pydantic_init_.py:206 in getattr │
│ │
│ 203 def getattr(attr_name: str) -> object: │
│ 204 │ dynamic_attr = _dynamic_imports.get(attr_name) │
│ 205 │ if dynamic_attr is None: │
│ > 206 │ │ return _getattr_migration(attr_name) │
│ 207 │ │
│ 208 │ from importlib import import_module │
│ 209 │
│ │
│ ┌─────────── locals ────────────┐ │
│ │ attr_name = 'parse_raw_as' │ │
│ │ dynamic_attr = None │ │
│ └───────────────────────────────┘ │
│ │
│ D:\server\anaconda3\envs\python31011\lib\site-packages\pydantic_migration.py:285 in wrapper │
│ │
│ 282 │ │ │ │ 'for more details.' │
│ 283 │ │ │ ) │
│ 284 │ │ if import_path in REMOVED_IN_V2: │
│ > 285 │ │ │ raise PydanticImportError(f'
{import_path}
has been removed in V2.') ││ 286 │ │ globals: Dict[str, Any] = sys.modules[module].dict │
│ 287 │ │ if name in globals: │
│ 288 │ │ │ return globals[name] │
│ │
│ ┌────────────────────────────── locals ───────────────────────────────┐ │
│ │ import_path = 'pydantic:parse_raw_as' │ │
│ │ module = 'pydantic' │ │
│ │ name = 'parse_raw_as' │ │
│ │ PydanticImportError = <class 'pydantic.errors.PydanticImportError'> │ │
│ └─────────────────────────────────────────────────────────────────────┘ │
└──────────────────────────────────────────────────────────────────────────────────────────────────┘
PydanticImportError:
pydantic:parse_raw_as
has been removed in V2.For further information visit https://errors.pydantic.dev/2.0.2/u/import-error
Beta Was this translation helpful? Give feedback.
All reactions