The labeling tool Labelimg is displayed in normal operation, but when you click Create RectBox to draw a rectangle on the picture, it starts to flash back

Description of the problem*: The labeling tool Labelimg runs normally and displays, but clicks Create RectBox to draw a rectangle on the picture and starts to crash, and the following code appears after the crash

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’

And when you click Create RectBox, no line comes out, and it flashes back after a few seconds


(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'

insert image description here

Solve the problem :

Because the python version in the Anaconda you installed may be too high. For example, the installed Anaconda is python3.11 version. If you change the python version to a lower level, then reinstall it and use the anaconda prompt .

We can create a new python low version environment and install it in it. Refer to the link below.
Install labelimg in Anaconda and use Anaconda Prompt detailed steps

Guess you like

Origin blog.csdn.net/qq_55433305/article/details/131817989