Opened 8 years ago

Closed 8 years ago

#52868 closed defect (fixed)

git-cola: no qt bindings could be found, wrong python version?

Reported by: skymoo (Adam Mercer) Owned by: raimue (Rainer Müller)
Priority: Normal Milestone:
Component: ports Version: 2.3.4
Keywords: Cc:
Port: git-cola

Description

Just installed git-cola on a Sierra machine and when trying to run it I receive the following:

$ git-cola
Traceback (most recent call last):
  File "/opt/local/bin/git-cola", line 53, in <module>
    from cola.main import main
  File "/opt/local/share/git-cola/lib/cola/main.py", line 9, in <module>
    from .app import add_common_arguments
  File "/opt/local/share/git-cola/lib/cola/app.py", line 32, in <module>
    from qtpy import QtCore
  File "/opt/local/share/git-cola/lib/qtpy/__init__.py", line 125, in <module>
    raise PythonQtError('No Qt bindings could be found')
qtpy.PythonQtError: No Qt bindings could be found
$

From the port dependencies it seems that git-cola is depending on python35 however the git-cola script is using python27 as it's interpreter:

$ head -1 /opt/local/bin/git-cola
#!/opt/local/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python
$

If I manually run the script with the python35 interpreter then is starts but isn't displayed correctly, see attached screen shot. I assume this is related to QT5 not support Sierra properly yet?

Attachments (1)

git-cola.png (13.9 KB) - added by skymoo (Adam Mercer) 8 years ago.

Download all attachments as: .zip

Change History (5)

Changed 8 years ago by skymoo (Adam Mercer)

Attachment: git-cola.png added

comment:1 Changed 8 years ago by skymoo (Adam Mercer)

Same display issue on El Capitan.

comment:2 Changed 8 years ago by raimue (Rainer Müller)

In 3502038/macports-ports:

git-cola: use right python interpreter in destroot

See: #52868

comment:3 Changed 8 years ago by raimue (Rainer Müller)

I can confirm I have the same display problem now. I might not have had that on Yosemite when I initially wrote this port.

I went with pyqt5, as although upstream sees pyqt4 as the stable variant, the bundled qtpy will prefer pyqt5 over pyqt4. The only way to change that without patching seems to be to export QT_API=pyqt4 in the environment before running git-cola.

Switching to py35-pyqt4 with this method seems to resolve the issue. I'll work on a patch to switch to our qtpy port and make git-cola prefer the pyqt4 interface.

comment:4 Changed 8 years ago by raimue (Rainer Müller)

Resolution: fixed
Status: newclosed

In e215228a/macports-ports:

git-cola: switch to pyqt4 by default, add +qt5

Running git-cola with Qt5 exposes some artifacts, which was at least
verified for 10.12 Sierra and 10.11 El Capitan. Switch to Qt4 as default
instead. The Qt5 version can still be enabled with the +qt5 variant.

In the same patch selecting a fixed pyqt version, remove a custom
addition to sys.path specific to Homebrew which is likely to mess up
running git-cola when it is installed in /usr/local.

Closes: #52868

Note: See TracTickets for help on using tickets.