I am using KDE Neon jammy 22.04 (Ubuntu based). It cames with Python3.10 installed. I also installed Python3.11 with sudo apt install python3.11
. I wrote a program using PyQt5. It works with Python3.10, but not Python3.11. My error is ModuleNotFoundError: No module named 'PyQt5.sip'
.
PyQt5 is in /usr/lib/python3/dist-packages/
. It is present neither in /usr/lib/python3.10
nor /usr/lib/python3.11
. /usr/local/lib/python3.10/dist-packages/
and /usr/local/lib/python3.11/dist-packages/
are empty. When I do :
$ python3.11 -c "import sys; print(sys.path)"
I can see
['', '/usr/lib/python311.zip', '/usr/lib/python3.11', '/usr/lib/python3.11/lib-dynload', '/home/richard/.local/lib/python3.11/site-packages', '/usr/local/lib/python3.11/dist-packages', '/usr/lib/python3/dist-packages']
So apparently my Python3.11 goes to look for packages in /usr/lib/python3/dist-packages
where PyQt5 is… the folder with PyQt5 is present. Why my PyQt5 program doesn’t work with my Python3.11 ? Why it says No module named 'PyQt5.sip'
? There is no difference between my package in python3.10 and python3.11.
Obviously if I create a virtual environment with Python3.11 and install PyQt5 in it, it works… but it’s not my point and I don’t want to add multiple installs for that.
Thanks