Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to run,lots of TypeError #1020

Closed
FallenSequoia opened this issue May 17, 2022 · 3 comments · Fixed by #1199
Closed

Unable to run,lots of TypeError #1020

FallenSequoia opened this issue May 17, 2022 · 3 comments · Fixed by #1199
Assignees
Labels

Comments

@FallenSequoia
Copy link

First off, I performed the following commands when installing (Windows 10, using Anaconda):
conda create --name=labelme python=3
conda activate labelme
pip install labelme

When i try to run labelme, I got the following error:

`Traceback (most recent call last):
File "E:\ProgramData\Anaconda3\envs\Image-style-transfer-gp\lib\site-packages\labelme\widgets\canvas.py", line 618, in paintEvent
p.translate(self.offsetToCenter())
File "E:\ProgramData\Anaconda3\envs\Image-style-transfer-gp\lib\site-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'

I don't know what caused the problem, maybe a version update of Qt?

@andrster1
Copy link

Hello, I've run into a similar problem. I tried opening the apc2016_obj3.jpg image for the tutorial and it throws a QtCore error, more specifically:

Traceback (most recent call last):
File "C:.conda\envs\labelme\lib\site-packages\labelme\app.py", line 1537, in loadFile
self.loadLabels(self.labelFile.shapes)
File "C:.conda\envs\labelme\lib\site-packages\labelme\app.py", line 1226, in loadLabels
self.loadShapes(s)
File "C:.conda\envs\labelme\lib\site-packages\labelme\app.py", line 1187, in loadShapes
self.addLabel(shape)
File "C:.conda\envs\labelme\lib\site-packages\labelme\app.py", line 1137, in addLabel
self.labelList.addItem(label_list_item)
File "C:.conda\envs\labelme\lib\site-packages\labelme\widgets\label_list_widget.py", line 167, in addItem
item.setSizeHint(self.itemDelegate().sizeHint(None, None))
File "C:.conda\envs\labelme\lib\site-packages\labelme\widgets\label_list_widget.py", line 64, in sizeHint
return QtCore.QSize(
TypeError: arguments did not match any overloaded call:
QSize(): too many arguments
QSize(int, int): argument 1 has unexpected type 'float'
QSize(QSize): argument 1 has unexpected type 'float'

I am running labelme on Windows 10 with Anaconda.

@andrster1
Copy link

I followed the advice by parksangback in this post #1006 (comment) and it runs smoothly.

@montmejat
Copy link

montmejat commented May 27, 2022

Apparently the QtCore API has changed in Python 3.10 and now some types are not allowed in different parts of the code. I can make a PR to add all of the int conversions and add support for Python 3.10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants