MatthiasSchinzel/sysmon

Error starting sysmon on Linux Mint 20.1-xfce

neigaard opened this issue · 3 comments

I have installed sysmon via pip3 (I do not have a pip command on my system) and when I run sysmon I get this error:

Traceback (most recent call last):
File "/home/neigaard/.local/bin/sysmon", line 5, in
from sysmon.sysmon import main
File "/home/neigaard/.local/lib/python3.8/site-packages/sysmon/sysmon.py", line 2, in
import pyqtgraph as pg
File "/home/neigaard/.local/lib/python3.8/site-packages/pyqtgraph/init.py", line 13, in
from .Qt import QtGui, mkQApp
File "/home/neigaard/.local/lib/python3.8/site-packages/pyqtgraph/Qt.py", line 137, in
from PyQt5 import QtGui, QtCore, QtWidgets, sip, uic
ImportError: cannot import name 'sip' from 'PyQt5' (/usr/lib/python3/dist-packages/PyQt5/init.py)

If I run "pip3 install numpy pyqtgraph pyqt5" I get this:

Requirement already satisfied: numpy in ./.local/lib/python3.8/site-packages (1.20.2)
Requirement already satisfied: pyqtgraph in ./.local/lib/python3.8/site-packages (0.12.1)
Requirement already satisfied: pyqt5 in /usr/lib/python3/dist-packages (5.14.1)

If I run "pip3 show sysmon" I get this:

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/neigaard/.local/lib/python3.8/site-packages
Requires: numpy, pyqtgraph, pyqt5
Required-by:

Any ideas?

Thank you
Søren

Hi, looks like a Problem with PyQtGraph to me, which has problems with the PyQt5 installation. As the error messages tell us, sip cannot be imported (from PyQt5).

So if this is the case this command probably already fails:
python -c "import pyqtgraph"
And this command will very likely fail with a similar error message and is the root of your problem:
python -c "from PyQt5 import sip"

Did you install PyQt5 already before with some other package manager, something like apt-get install python3-pyqt5?
Not a 100% sure, but I think the path /usr/lib/python3/dist-packages is used by for example apt, whereas site-packages (./.local/lib/python3.8/site-packages) is used by pip.
With
dpkg -l | grep "pyqt"
you can see if you also installed PyQt5 via a packet manager.
And with
pip list | grep "PyQt"
you can check the pip installed version.

It would be great if you can post the output of the commands here. Thank you!

Thank you for getting back to me.

I have Python3 installed via the Mint Software Manager (and it seems to be impossible to uninstall, I guess it is needed by Mint somehow). Hereunder you have the output of those two commands, using pip3 not pip as I do not have a pip command.

dpkg -l | grep "pyqt"
ii python3-pyqt5 5.14.1+dfsg-3build1 amd64 Python 3 bindings for Qt5
ii python3-pyqt5.qtsvg 5.14.1+dfsg-3build1 amd64 Python 3 bindings for Qt5's SVG module
ii python3-pyqt5.qtwebchannel 5.14.1+dfsg-3build1 amd64 Python 3 bindings for Qt5's WebChannel module
ii python3-pyqt5.qtwebengine 5.14.0-2build1 amd64 Python 3 bindings for Qt5's WebEngine module

pip3 list | grep "PyQt"
PyQt5 5.14.1
PyQt5-sip 12.8.1
PyQtWebEngine 5.14.0

Thank you
Søren

Running "pip3 install sysmon --force" fixed my problem :)