doccano 解决 pydantic.errors.PydanticImportError: `pydantic:ConstrainedStr` has been removed in V2.

报错信息

  File "C:\Users\anaconda3\envs\UIE\lib\site-packages\pydantic\_migration.py", line 285, in wrapper
    raise PydanticImportError(f'`{import_path}` has been removed in V2.')
pydantic.errors.PydanticImportError: `pydantic:ConstrainedStr` has been removed in V2.

For further information visit https://errors.pydantic.dev/2.0.2/u/import-error

...

  File "C:\Users\anaconda3\envs\UIE\lib\site-packages\backend\data_import\datasets.py", line 12, in <module>
    from .pipeline.label import CategoryLabel, Label, RelationLabel, SpanLabel, TextLabel
  File "C:\Users\anaconda3\envs\UIE\lib\site-packages\backend\data_import\pipeline\label.py", line 5, in <module>
    from pydantic import UUID4, BaseModel, ConstrainedStr, NonNegativeInt, root_validator
  File "C:\Users\anaconda3\envs\UIE\lib\site-packages\pydantic\__init__.py", line 206, in __getattr__
    return _getattr_migration(attr_name)
  File "C:\Users\anaconda3\envs\UIE\lib\site-packages\pydantic\_migration.py", line 285, in wrapper
    raise PydanticImportError(f'`{import_path}` has been removed in V2.')
pydantic.errors.PydanticImportError: `pydantic:ConstrainedStr` has been removed in V2.

For further information visit https://errors.pydantic.dev/2.0.2/u/import-erro

网页也无法打开

Internal Server Error

The server encountered an unexpected internal server error

(generated by waitress)

在这里插入图片描述

环境

python3.9, python3.10 都支持
本人使用的是 doccano==1.8.3

描述

以前可以使用 doccano没有任何问题。
直到本人重新安装python 或者 创建新的python环境后,便无法使用 doccano
因为 doccano 将配置信息写在用户文件夹下的 doccano文件夹内,删去该文件夹,删去以前的配置信息;

同时还有下述错误:

  1. doccano 的webserver 网页打不开
  2. doccano 导出的数据集没有标注数据

解决措施

  1. 删除用户目录下的 doccano文件夹,重新执行 doccano init
    在这里插入图片描述

  2. pip install pydantic==1.10.11

  3. 如果执行上述步骤,仍不能解决此问题,可尝试降低 doccano版本: pip install doccano==1.6.2

其他

doccano一直转圈圈

  • doccano上传文件一直转圈圈
  • doccano下载文件一直转圈圈
    在另一个命令窗口执行: doccano task
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

jieshenai

为了遇见更好的文章

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值