labelme报错问题解决

报错现象:

2025-07-08 14:36:50.371 | CRITICAL | labelme.__main__:_handle_exception:69 - Traceback (most recent call last):

  File "D:\Anaconda3\envs\labelme1\lib\site-packages\labelme\widgets\canvas.py", line 465, in mousePressEvent

    self.selectShapePoint(pos, multiple_selection_mode=group_mode)

    self.calculateOffsets(point)

    self.offsets = QtCore.QPoint(x1, y1), QtCore.QPoint(x2, y2)

TypeError: arguments did not match any overloaded call:

  QPoint(): too many arguments

  QPoint(xpos: int, ypos: int): argument 1 has unexpected type 'float'

  QPoint(a0: QPoint): argument 1 has unexpected type 'float'

 解决办法:

有的博主的方法是更改源代码,不建议这么做。我这么做了以后出现了其他问题。

我的解决方案是使用3.9版本的python,我测试了3.7,3.8,3.10,3.11都不行。更换成3.9就可以了。
创建好了3.9版本环境以后直接 复制下面指令进行安装

pip install labelme -i  https://pypi.tuna.tsinghua.edu.cn/simple

 

posted @ 2025-07-08 15:52  alfred_zbz  阅读(127)  评论(0)    收藏  举报