The solution to the error report when labelimg clicks on the box to select the picture (not necessarily universal)

Error:

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'

Solution:

1. Return the python version to 3.9

Win 10 environment: Pycharm, anaconda, python3.10

Note: anaconda download and configuration environment variable reference:

(6 messages) Anaconda super detailed installation tutorial (under Windows environment)_windows installation conda_cainiao No. 1! ! Blog-CSDN Blog


1), open cmd
2), execute the following command
conda install python==3.9
3), check the python version , whether the version is downgraded successfully
python --version or python -V

Reference link: (6 messages) [Win 10]Python version down method, Python3.9 down to 3.7_Bouble Q's Blog-CSDN Blog

2. Change the float in lines 526, 530, and 531 of the canvas.py file to int. (If you can't find the file, just search directly)

Before:

After the change:

Reference link:

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

After I finish the modification, I can select the frame normally, but it may not be applicable to your situation~~~

Guess you like

Origin blog.csdn.net/red_flag1921/article/details/130487444