MatthiasSchinzel / sysmon

Graphical system monitor for linux, including information about CPU, GPU, Memory, HDD/SDD and your network connections. Similar to windows task manager.
GNU General Public License v3.0
294 stars 25 forks source link

QHeaderView object has no attribute setResizeMode. Did you mean: ResizeMode? #31

Closed henriquedesousa closed 1 year ago

henriquedesousa commented 1 year ago

Hello, I'm using Linux Mint 21 Cinnamon which is based on ubuntu 22.04 but when I try to run sysmon, installed with pip install sysmon, the following error occurs:

username@laptop:~$ sysmon
Traceback (most recent call last):
  File "/home/username/.local/bin/sysmon", line 8, in <module>
    sys.exit(main())
  File "/home/username/.local/lib/python3.10/site-packages/sysmon/sysmon.py", line 607, in main
    main = MainWindow()
  File "/home/username/.local/lib/python3.10/site-packages/sysmon/sysmon.py", line 119, in __init__
    header.setResizeMode(QtGui.QHeaderView.ResizeToContents)
AttributeError: 'QHeaderView' object has no attribute 'setResizeMode'. Did you mean: 'ResizeMode'?

How can I help you debug this issue? Many thanks in advance,

username@laptop:~$ pip show sysmon
Name: sysmon
Version: 1.0.1
Summary: System Monitor for Linux
Home-page: https://github.com/MatthiasSchinzel/sysmon
Author: Matthias Schinzel
Author-email: unused@unused.com
License: UNKNOWN
Location: /home/username/.local/lib/python3.10/site-packages
Requires: numpy, pyqt5, pyqtgraph
Required-by: 
henriquedesousa commented 1 year ago

Maybe this is related: https://codereview.qt-project.org/c/qt/qtbase/+/425133

lonelybsh commented 1 year ago

Hi, I met the same issue. And I find that by correcting setResizeMode to setSectionResizeMode, and then change some QtGui to QtWidgets in the sysmon.py from the error report in the commandline, the problem seems fixed. Hope this can be helpful. :D

henriquedesousa commented 1 year ago

Hi, I met the same issue. And I find that by correcting setResizeMode to setSectionResizeMode, and then change some QtGui to QtWidgets in the sysmon.py from the error report in the commandline, the problem seems fixed. Hope this can be helpful. :D

Cool, it worked, thanks~!! And to add to your answer, the lines where one has to change QtGui to QtWidgets are 119, 123, 595 and 598.

henriquedesousa commented 1 year ago

Also line 138, 151->158, 160, 161, 163, 164, 166, 167, 169, 170..

aslmx commented 1 year ago

I could get this working to by doing some replacements... but is this going to be considered to be fixed? I mean i know how i could send a PR that fixes includes the lines that i fixed for myself. But i don't feel confident enough to judge whether this will break the code for other setups...

(Linux Mint 21.2 here as well...)

henriquedesousa commented 1 year ago

I could get this working to by doing some replacements... but is this going to be considered to be fixed? I mean i know how i could send a PR that fixes includes the lines that i fixed for myself. But i don't feel confident enough to judge whether this will break the code for other setups...

I think the project is dead, because the author is absent since 3 years. You could fork this and submit the fix commit, that way people will have a direct working project to checkout.

MatthiasSchinzel commented 1 year ago

Hi, sorry I don’t have time to fix this at the moment but if you have a PR that would be great. Then we can check if it would break or not and submit to pip.

aslmx commented 1 year ago

Hi, sorry I don’t have time to fix this at the moment but if you have a PR that would be great. Then we can check if it would break or not and submit to pip.

I created a PR here - hope that helps...

https://github.com/MatthiasSchinzel/sysmon/pull/33

(I am not an experienced contributor, so please be patient with me :wink: )