Bitmessage/PyBitmessage

PyQt5 import in qidenticon conflicts with installed PyQt4 if user has both

g1itch opened this issue · 2 comments

Hello!

This is just appeared in the chan.

2021-12-11 16:56:33,495 - WARNING - Using default logger configuration
2021-12-11 16:56:33,777 - CRITICAL - Unhandled exception
Traceback (most recent call last):
  File "/usr/local/bin/pybitmessage", line 11, in <module>
    execfile(script_file, new_globals)
  File "/usr/local/lib/python2.7/dist-packages/pybitmessage/bitmessagemain.py", line 426, in <module>
    main()
  File "/usr/local/lib/python2.7/dist-packages/pybitmessage/bitmessagemain.py", line 422, in main
    mainprogram.start()
  File "/usr/local/lib/python2.7/dist-packages/pybitmessage/bitmessagemain.py", line 296, in start
    bitmessageqt.run()
  File "/usr/local/lib/python2.7/dist-packages/pybitmessage/bitmessageqt/__init__.py", line 4186, in run
    myapp = MyForm()
  File "/usr/local/lib/python2.7/dist-packages/pybitmessage/bitmessageqt/__init__.py", line 621, in __init__
    self.ui.setupUi(self)
  File "/usr/local/lib/python2.7/dist-packages/pybitmessage/bitmessageqt/bitmessageui.py", line 566, in setupUi
    self.blackwhitelist.rerenderBlackWhiteList()
  File "/usr/local/lib/python2.7/dist-packages/pybitmessage/bitmessageqt/blacklist.py", line 178, in rerenderBlackWhiteList
    newItem.setIcon(avatarize(address))
  File "/usr/local/lib/python2.7/dist-packages/pybitmessage/bitmessageqt/utils.py", line 116, in avatarize
    return identiconize(address)
  File "/usr/local/lib/python2.7/dist-packages/pybitmessage/bitmessageqt/utils.py", line 39, in identiconize
    import qidenticon
  File "/usr/local/lib/python2.7/dist-packages/pybitmessage/qidenticon.py", line 46, in <module>
    from PyQt5 import QtCore, QtGui
RuntimeError: the PyQt5.QtCore and PyQt4.QtCore modules both wrap the QObject class

I should've probably add a check for the situation when the end user has both PyQt4 and PyQt5 python2 libs.

maybe some sort of helper_qt, or unify approach with #1389?

maybe some sort of helper_qt, or unify approach with #1389?

Hopely I can avoid another helper. Need to investigate it further. qidenticon should not be the first module importing Qt, at least in the qt5-wip.