标注工具Labelimg,正常运行显示,但是对图片点击Create RectBox画矩形框开始闪退

问题描述*:标注工具Labelimg,正常运行显示,但是对图片点击Create RectBox画矩形框开始闪退,闪退出现以下代码

File "C:\ProgramData\anaconda3\Lib\site-packages\libs\canvas.py", line 530, in paintEvent

p.drawLine(self.prev_point.x(), 0, self.prev_point.x(), self.pixmap.height())

TypeError: arguments did not match any overloaded call:

drawLine(self, l: QLineF): argument 1 has unexpected type 'float'

drawLine(self, line: QLine): argument 1 has unexpected type 'float'

drawLine(self, x1: int, y1: int, x2: int, y2: int): argument 1 has unexpected type 'float'

drawLine(self, p1: QPoint, p2: QPoint): argument 1 has unexpected type 'float'

drawLine(self, p1: UnionQPointF, QPoint, p2: UnionQPointF, QPoint): argument 1 has unexpected type 'float'

而且点击Create RectBox点没有线出来,过几秒闪退

c 复制代码
(base) PS C:\Users\Administrator> labelimg
Traceback (most recent call last):
  File "C:\ProgramData\anaconda3\Lib\site-packages\libs\canvas.py", line 530, in paintEvent
    p.drawLine(self.prev_point.x(), 0, self.prev_point.x(), self.pixmap.height())
TypeError: arguments did not match any overloaded call:
  drawLine(self, l: QLineF): argument 1 has unexpected type 'float'
  drawLine(self, line: QLine): argument 1 has unexpected type 'float'
  drawLine(self, x1: int, y1: int, x2: int, y2: int): argument 1 has unexpected type 'float'
  drawLine(self, p1: QPoint, p2: QPoint): argument 1 has unexpected type 'float'
  drawLine(self, p1: Union[QPointF, QPoint], p2: Union[QPointF, QPoint]): argument 1 has unexpected type 'float'

解决问题

因为可能你安装的Anaconda里python版本过高,比如装的Anaconda是python3.11版本,重把python版本改低一点,那就重新装一个,用anaconda prompt

我们可以新建python低版本环境,在里面在安装。参考以下链接。
Anaconda里装labelimg使用Anaconda Prompt详细步骤

相关推荐
Zane199411 分钟前
daemon 线程说没就没?一文讲透 threading 的适用场景与线程安全
后端·python
up up day15 分钟前
Python enchant 模块使用教程
python
zoujiahui_201816 分钟前
Python 包与环境管理工具 uv
开发语言·python·uv
吴声子夜歌29 分钟前
Java面试题——JVM(二)
java·开发语言·jvm
CRMEB31 分钟前
商城大促活动策划全流程:从定目标到复盘四阶段
java·开发语言·人工智能·ai·开源·php
denglinqings32 分钟前
Java开发从入门到精通所有课程
java·开发语言
程序猿阿森1 小时前
Python 闭包与装饰器:从入门到精通
开发语言·python·面试
老大白菜1 小时前
Qwen3.8-27B 本地推理 + DeepSeek Harness 配置
python·qwen·deepseek·harness
余额瞒着我当琳1 小时前
C++--vector底层,leetcode118杨辉三角实战,对于传统reserve的坑点,迭代器失效
开发语言·c++
曹牧1 小时前
C#:字符串做20位截断
开发语言·c#