Bug report #19040

QGIS 3 can't start or no Python support on Xenial

Added by Lee Hachadoorian almost 6 years ago. Updated almost 6 years ago.

Status:Closed
Priority:Normal
Assignee:Denis Rouzaud
Category:Python bindings / sipify
Affected QGIS version:3.0.3 Regression?:No
Operating System:Linux Mint 18.2 (Ubuntu Xenial) Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:Yes Copied to github as #:26870

Description

Trying to use QGIS 3 with ubuntugis dependencies on Xenial. Installing from https://qgis.org/ubuntugis.

QGIS depends on python-qgis which depends on python3-pyqt5. The version available in Xenial repos is 5.5.1. When I try to launch QGIS, I get the splash screen, then nothing happens.

If I start a Python3 console and try to check the PyQt5 version, Python crashes:

$ python3
Python 3.5.2 (default, Nov 23 2017, 16:37:01) 
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from PyQt5.QtCore import QT_VERSION_STR
Segmentation fault
$

I tried installing a more recent version of PyQt5 (5.10) using pip. In this case, when I start QGIS, I get the following dialog:

Couldn't load PyQt.
Python support will be disabled.

Traceback (most recent call last):
  File "", line 1, in 
ImportError: /usr/lib/x86_64-linux-gnu/libQt5Core.so.5: version `Qt_5.10' not found (required by /usr/local/lib/python3.5/dist-packages/PyQt5/QtCore.so)

Python version:
3.5.2 (default, Nov 23 2017, 16:37:01) 
[GCC 5.4.0 20160609]

QGIS version:
3.0.3-Girona 'Girona', 8a899c8

Python path:
Couldn't load PyQt.
Python support will be disabled.

Traceback (most recent call last):
  File "", line 1, in 
ImportError: /usr/lib/x86_64-linux-gnu/libQt5Core.so.5: version `Qt_5.10' not found (required by /usr/local/lib/python3.5/dist-packages/PyQt5/QtCore.so)

Python version:
3.5.2 (default, Nov 23 2017, 16:37:01) 
[GCC 5.4.0 20160609]

QGIS version:
3.0.3-Girona 'Girona', 8a899c8

Python path:
Couldn't load PyQt.
Python support will be disabled.

Traceback (most recent call last):
  File "", line 1, in 
ImportError: /usr/lib/x86_64-linux-gnu/libQt5Core.so.5: version `Qt_5.10' not found (required by /usr/local/lib/python3.5/dist-packages/PyQt5/QtCore.so)

Python version:
3.5.2 (default, Nov 23 2017, 16:37:01) 
[GCC 5.4.0 20160609]

QGIS version:
3.0.3-Girona 'Girona', 8a899c8

Python path:
['/usr/share/qgis/python', '/home/lee/.local/share/QGIS/QGIS3/profiles/default/python', '/home/lee/.local/share/QGIS/QGIS3/profiles/default/python/plugins', '/usr/share/qgis/python/plugins', '/usr/lib/python35.zip', '/usr/lib/python3.5', '/usr/lib/python3.5/plat-x86_64-linux-gnu', '/usr/lib/python3.5/lib-dynload', '/home/lee/.local/lib/python3.5/site-packages', '/usr/local/lib/python3.5/dist-packages', '/usr/lib/python3/dist-packages']

After closing the dialog, QGIS starts and is usable, but without Python support (hence, no plugins).

History

#1 Updated by Lee Hachadoorian almost 6 years ago

Additional information:

I installed QGIS 3 on Bionic. (I know original problem was reported on Xenial.)

  • When using OS-supplied PyQt5, QGIS 3 loads.
  • When using PyPI-supplied PyQt5, the same error (version `Qt_5.10' not found) occurs.

I wonder if this problem is related to this issue reported against Anaconda: https://github.com/ContinuumIO/anaconda-issues/issues/1554. The TL;DR is that the OS-supplied package is named `pyqt` while the PyPI package is named `PyQt5`, and when PyQt5 is installed via pip, Anaconda can't find it because it is looking for `pyqt`. Perhaps the same thing is happening here?

Obviously, OS-supplied PyQt5 not working on Xenial is not a QGIS problem. However, the easy solution would seem to be to install the PyPI version, and that fails on both Xenial and Bionic. I don't think that QGIS should have a requirement to not have PyQt5 installed via PyPI in order to work.

#2 Updated by Jürgen Fischer almost 6 years ago

  • Priority changed from High to Normal
  • Status changed from Open to Closed

Lee Hachadoorian wrote:

Obviously, OS-supplied PyQt5 not working on Xenial is not a QGIS problem. However, the easy solution would seem to be to install the PyPI version, and that fails on both Xenial and Bionic. I don't think that QGIS should have a requirement to not have PyQt5 installed via PyPI in order to work.

QGIS is supposed to work with the OS supplied PyQt5 - but the OS supplied PyQt5 should obviously work (not sure why it didn't for the original reporter - but no QGIS issue). If the QGIS packages also work with a different PyQt5 version, that's more or less luck (for xenial there is no chance as it has Qt 5.5 and PyPI has 5.10; but for bionic it's at least 5.10 on both sides). Installing from PyPI should bring in it's own version of Qt, which might be incompatible with the Qt version QGIS uses. QGIS and PyQt5 should use the same version of Qt.

Also available in: Atom PDF