报错:
Traceback (most recent call last):
File "C:Users86186AppDataLocalProgramsPythonPython310libsite-packageslibscanvas.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
我改完以后即可正常框选,不过不一定适用你们的情况~~~
本文发布于:2024-01-29 07:51:49,感谢您对本站的认可!
本文链接:https://www.4u4v.net/it/170648591313806.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
留言与评论(共有 0 条评论) |