git-cola icon indicating copy to clipboard operation
git-cola copied to clipboard

PyQt5 gotcha: git-cola gives misleading "PySide module not found" error

Open kmbgit opened this issue 4 years ago • 0 comments

Running Ubuntu 20.04 under Windows 10 WSL I get a No Qt bindings could be found error even though PyQt5 is installed as a dependency of git-cola by apt install. The problem is that libQt5Core.so.5 fails to load because it calls a kernel function that doesn't exist in the distribution I'm using. The fix is to run sudo strip --remove-section=.note.ABI-tag /usr/lib/x86_64-linux-gnu/libQt5Core.so.5. See https://askubuntu.com/a/1163268/358938 for the discussion that led me to this fix.

I know this isn't git-cola's fault, but hopefully others will find this solution when they search for the same symptom as me.

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/qtpy/__init__.py", line 204, in <module>
    from PySide import __version__ as PYSIDE_VERSION  # analysis:ignore
ModuleNotFoundError: No module named 'PySide'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/git-cola", line 53, in <module>
    from cola.main import main
  File "/usr/share/git-cola/lib/cola/main.py", line 6, in <module>
    from . import app
  File "/usr/share/git-cola/lib/cola/app.py", line 16, in <module>
    from qtpy import QtCore
  File "/usr/lib/python3/dist-packages/qtpy/__init__.py", line 210, in <module>
    raise PythonQtError('No Qt bindings could be found')
qtpy.PythonQtError: No Qt bindings could be found

kmbgit avatar Oct 07 '21 09:10 kmbgit