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 after installation #1006

Closed
lightbearer88 opened this issue Mar 22, 2022 · 9 comments · Fixed by #1199
Closed

Unable to run after installation #1006

lightbearer88 opened this issue Mar 22, 2022 · 9 comments · Fixed by #1199
Assignees
Labels
bug issue priority: high High priority

Comments

@lightbearer88
Copy link

Hi,

First off, I performed the following commands when installing (Windows 10, using Anaconda):

conda create --name=labelme python=3
source activate labelme
conda install labelme -c conda-forge

After that, I used the following command in Jupyter Notebooks:

!labelme

And I got the following error:

Traceback (most recent call last):
  File "C:\Pythons\envs\labelme\Scripts\labelme-script.py", line 6, in <module>
    from labelme.__main__ import main
  File "C:\Pythons\envs\labelme\lib\site-packages\labelme\__init__.py", line 17, in <module>
    QT4 = QT_VERSION[0] == "4"
TypeError: 'NoneType' object is not subscriptable

Did I do something wrong or is there a bug?

@llokng922
Copy link

This is probably because pyqt is not installed probably.

@ksooklall
Copy link

ksooklall commented Mar 31, 2022

I had the same issue then ran conda install -c anaconda pyqt, but now I have this issue

Traceback (most recent call last):
  File "/home/kenan/anaconda3/envs/labelme/lib/python3.10/site-packages/labelme/widgets/canvas.py", line 618, in paintEvent
    p.translate(self.offsetToCenter())
  File "/home/kenan/anaconda3/envs/labelme/lib/python3.10/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'
Aborted (core dumped)

Also I am on Ubuntu 18.04 and sudo apt-get install labelme doesn't work either

@parksangback
Copy link

parksangback commented Apr 3, 2022

I resolved this problem!! just modify the code. It seems there is no error about that

cd /home/<input_your_ubuntu_name>/anaconda3/envs/labelme/lib/python3.10/site-packages/labelme/widgets/
sudo gedit canvas.py
In the scripts ,key input (Ctrl+f :return QtCore.QPoint(x, y)).
Then you can see the code which is making the error.
Let's change the code about like under line!!
from
return QtCore.QPoint(x, y)
to
return QtCore.QPoint(int(x),int(y))

Now it will be running!!! Let's labeling about your data!!!!
!GOOD LUCK!

ADDITION!!
when you resolved this error by above method, you would run the program.
HOWERVER there are many error which is similar the launch error.

Just follow under line

  1. labelme
  2. scroll your mouse,then you will meet a error ( omit: float problem)
  3. modify code like launch error resolved
  4. press Arrow keys (up,down,left,right).... each keys makes error
  5. you must modify like launch error resolved
  6. save label -> make error -> modify

HAHAHA... fuk

@mkpvasu
Copy link

mkpvasu commented Apr 8, 2022

After solving the above error, I am running to an additional error

Traceback (most recent call last):
File "C:\Users\username\anaconda3\envs\labelme\lib\site-packages\labelme\widgets\canvas.py", line 245, in mouseMoveEvent
if QtCore.Qt.RightButton & ev.buttons():
TypeError: unsupported operand type(s) for &: 'MouseButton' and 'MouseButtons'

Does anyone know how to rectify this?

@montmejat
Copy link

Any news on this? How could it work before with return QtCore.QPoint(x, y)?

@oikonochristina
Copy link

i am having the same issue with @mkpvasu , how could we solve this typeError?

@jc0725
Copy link

jc0725 commented Jun 13, 2022

I had the same problem but resolved it by using a different python version (I used python3.8).

conda create --name=labelme python=3.8

@wkentaro wkentaro added the bug issue label Jun 25, 2022
@LancerXE
Copy link

It might because pyqt5 is not installed, try this:
pip install pyqt5
and then run labelme: labelme

@danilosjc
Copy link

Hey, I fixed the problem. I just did the following:
First I did the changes like @parksangback said above

cd /home/<input_your_ubuntu_name>/anaconda3/envs/labelme/lib/python3.10/site-packages/labelme/widgets/
sudo gedit canvas.py
In the scripts ,key input (Ctrl+f :return QtCore.QPoint(x, y)).
Then you can see the code which is making the error.
Let's change the code about like under line!!
from
return QtCore.QPoint(x, y)
to
return QtCore.QPoint(int(x),int(y))

But I continued getting error (but a different one).
So I installed pyqt5 and natshore with pip

and edited the files app.py and label_list_widget.py

I replaced my app.py by https://github.com/wkentaro/labelme/blob/main/labelme/app.py and edited line 1373 like this instruction:

For details: In file app.py under root dir of label me, line 1373 about, should force change type to int:

def setScroll(self, orientation, value):
self.scrollBars[orientation].setValue(int(value))
self.scroll_values[orientation][self.filename] = value

and also edited the file label_list_widget.py as follow

In file label_list_widget.py under widgets, in the method sizeHint, a force type change to in should be added: about line 62

def sizeHint(self, option, index):
thefuckyourshitup_constant = 4
return QtCore.QSize(
int(self.doc.idealWidth()),
int(self.doc.size().height() - thefuckyourshitup_constant),
)

Source: https://pythontechworld.com/issue/wkentaro/labelme/1159

Good luck!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug issue priority: high High priority
Projects
None yet
Development

Successfully merging a pull request may close this issue.