The following error shows when I am trying to open QGIS 3.0. Although I have installed PyQt5 and the module can be imported from python.
I am using Ubuntu 16.04 LTS
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It only takes a minute to sign up.
Sign up to join this communityThe following error shows when I am trying to open QGIS 3.0. Although I have installed PyQt5 and the module can be imported from python.
I am using Ubuntu 16.04 LTS
Perhaps it is due to some bug in QGIS 3.0 as it was the case with QGIS 2.18 see https://issues.qgis.org/issues/16743 one thing you can do to solve this issue is to install latest version QGIS 3.0.2 from https://qgis.org/en/site/forusers/download.html and hope that it was taken care of or you can report it as bug.
QGIS is supposed to work with the OS-supplied PyQt5. In this case I was able to reproduce your error by installing PyQt5 from PyPI. I was able to confirm the same problem in the Ubuntu 18.04 LTS.
Try removing the PyPI-supplied PyQt5 and seeing if QGIS 3 launches:
sudo pip3 uninstall PyQt5
Note: You may still be unable to run QGIS 3. I have tried this on two different systems, and PyQt5 cannot be imported by Python3 for one of the systems. They are not exactly the same, but both of them are distros based on Ubuntu 16.04. Both of them have the exact same versions of Python3, PyQt5, and SIP, from the exact same repository. I'm not sure why it works on one and not on the other, but this is a Python problem, not a QGIS problem. The suggested solution seems to be to compile PyQt yourself.
References:
Possibly related: