pydm
pydm copied to clipboard
PyDm fails with PyQt5 installed from Homebrew on Mac
I have installed V1.11.1 following instructions from http://slaclab.github.io/pydm/. I first setup my standalone environment using instructions at http://slaclab.github.io/pydm/installation.html and https://www.riverbankcomputing.com/static/Docs/PyQt5/installation.html#building-and-installing-from-source
When starting up pydm I get the following error:
bash-3.2$ pydm
_Traceback (most recent call last):
File "/usr/local/bin/pydm", line 8, in
I am running with PyQt5 v5.15.4_2 and Qt v5.15.2 with python 3.9.6 all installed with Mac Homebrew on macOS 11.4. I have tried removing the immediate dependency on qRound but then pydm fails trying to load QVariant: ImportError: cannot import name 'QVariant' from 'qtpy.QtCore' (/usr/local/lib/python3.9/site-packages/qtpy/QtCore.py)
Any advice?
Hi @pjyoung, PyDM uses a module called 'qtpy' to try and paper over the differences between (PyQt4, PyQt5, and PySide2). From the errors, it looks like qtpy has decided to use PySide2 instead of PyQt. But - PySide2 doesn't expose the qRound function at all, which we use.
You can force qtpy to use a particular Python-Qt binding using the QT_API
environment variable. Try doing export QT_API=pyqt5
before running PyDM, and see if that fixes it...