labelme icon indicating copy to clipboard operation
labelme copied to clipboard

Application crashes in Ubuntu 22.04

Open jesstytam opened this issue 7 months ago • 2 comments

Provide environment information

/home/user/mambaforge/bin/python Python 3.10.10

What OS are you using?

Ubuntu 22.04

Describe the Bug

I ran sudo apt-get install labelme to install the application and then ran labelme to open it, but after a few seconds of opening the app, it crashed.

Here is the error from the terminal:

[INFO   ] __init__:get_config:70 - Loading config file from: /home/user/.labelmerc
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/labelme/widgets/canvas.py", line 618, in paintEvent
    p.translate(self.offsetToCenter())
  File "/usr/lib/python3/dist-packages/labelme/widgets/canvas.py", line 659, in offsetToCenter
    return QtCore.QPoint(x, y)
TypeError: arguments did not match any overloaded call:
  QPoint(): too many arguments
  QPoint(int, int): argument 1 has unexpected type 'float'
  QPoint(QPoint): argument 1 has unexpected type 'float'
Error in sys.excepthook:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 153, in apport_excepthook
    with os.fdopen(os.open(pr_filename,
FileNotFoundError: [Errno 2] No such file or directory: '/var/crash/_usr_bin_labelme.1000.crash'

Original exception was:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/labelme/widgets/canvas.py", line 618, in paintEvent
    p.translate(self.offsetToCenter())
  File "/usr/lib/python3/dist-packages/labelme/widgets/canvas.py", line 659, in offsetToCenter
    return QtCore.QPoint(x, y)
TypeError: arguments did not match any overloaded call:
  QPoint(): too many arguments
  QPoint(int, int): argument 1 has unexpected type 'float'
  QPoint(QPoint): argument 1 has unexpected type 'float'
QBackingStore::endPaint() called with active painter; did you forget to destroy it or call QPainter::end() on it?
QPainter::begin: Painter already active
Segmentation fault (core dumped)

Expected Behavior

No response

To Reproduce

No response

jesstytam avatar Dec 19 '23 04:12 jesstytam

Line 830 in [labelme/widgets/canvas.py]

from

return QtCore.QPointF(x, y)

change to

return QtCore.QPointF(int(x), int(y))

step305 avatar Dec 19 '23 17:12 step305

@jesstytam Good afternoon, use the brew tool, because I had the same problem. I used brew to install and it was successful.

brew install pyqt  # maybe pyqt5
brew install wkentaro/labelme/labelme  # command line interface

# brew install --cask wkentaro/labelme/labelme  # app

# or install standalone executable/app from:
# https://github.com/wkentaro/labelme/releases

sc0v0ne avatar Dec 19 '23 17:12 sc0v0ne