报错:

Traceback (most recent call last):   File "C:\Users\86186\AppData\Local\Programs\Python\Python310\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'

解决方法:

1、将python版本退回3.9

Win 10 环境:Pycharm、anaconda、python3.10

注:anaconda下载及配置环境变量参考:

(6条消息) Anaconda超详细安装教程(Windows环境下)_windows安装conda_菜鸟1号!!的博客-CSDN博客

1)、打开cmd 2)、执行下列命令 conda install python==3.9 3)、查看python版本,是否降版本成功 python --version 或 python -V

参考链接:(6条消息) [Win 10]Python降版本方法、Python3.9降至3.7_Bouble Q的博客-CSDN博客

2、将canvas.py文件 526、530、531行的float改为int。(找不到文件的话,直接搜索就行)

改前:

改后:

参考链接:

Unable to draw annotations on Windows · Issue #811 · heartexlabs/labelImg · GitHub

我改完以后即可正常框选,不过不一定适用你们的情况~~~

推荐阅读

评论可见,请评论后查看内容,谢谢!!!
 您阅读本篇文章共花了: