标注工具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详细步骤

相关推荐
郭老二8 小时前
【Python】基本语法:装饰器语法糖@
python
kite01218 小时前
Go语言Map深度解析与最佳实践
开发语言·后端·golang
_Jimmy_9 小时前
Agent常用检索器的详细介绍
python·langchain
小柯南敲键盘10 小时前
图片翻译API接入与自动化实现指南
运维·python·自动化
l1564694810 小时前
突围!图文混合知识库难以解析,Kimi-K3 原生视觉架构深耕知识工作,DMXAPI 统一接口,缩短项目开发周期
java·大数据·开发语言
旅僧10 小时前
Q-learning(自用)
python·机器学习
charlie11451419110 小时前
现代C++工程实践 WeakPtr 实战(三):WeakPtrFactory 与「最后成员」惯用法
开发语言·c++·开源项目·现代c++
Python大数据分析@10 小时前
曝梁文锋称「一度不想维护C端用户,奈何赶不走」,DeepSeek真不需要C端用户吗?可能会有啥影响吗?
python
艾斯特_12 小时前
工作流与多Agent协作:LangGraph、MCP和A2A的应用分层
人工智能·python·ai
IT小盘12 小时前
04-大模型流式输出原理-SSE与Python实现
开发语言·网络·人工智能·python