joinmarket-clientserver icon indicating copy to clipboard operation
joinmarket-clientserver copied to clipboard

joinmarket-qt.py: TypeError: 'Shiboken.ObjectType' object is not iterable

Open github12101 opened this issue 2 years ago • 16 comments

Hi all,

I encountered reproducible error which prevents joinmarket-qt.py from running. I use Debian 11 Bullseye on AMD64, fully updated.

My steps to reproduce:

  1. wget https://github.com/JoinMarket-Org/joinmarket-clientserver/archive/refs/tags/v0.9.2.tar.gz

  2. tar xzvf v0.9.2.tar.gz

  3. cd joinmarket-clientserver-0.9.2/

  4. ./install.sh (selected YES for Qt deps) That churned for a few minutes. Among other things, I seen in the output:

configure: WARNING: unrecognized options: --disable-jni
(...)
PASS: exhaustive_tests
PASS: tests
============================================================================
Testsuite summary for libsecp256k1 0.1
============================================================================
# TOTAL: 2
# PASS:  2
(...)
Testsuite summary for libsodium 1.0.18
============================================================================
# TOTAL: 69
# PASS:  69
(...)
Installing XDG desktop entry
Joinmarket successfully installed
  1. source jmvenv/bin/activate

  2. python scripts/joinmarket-qt.py

Traceback (most recent call last):
  File "/home/nv01/joinmarket-clientserver-0.9.2/scripts/joinmarket-qt.py", line 58, in <module>
    from jmbase import get_log, stop_reactor
  File "/home/nv01/joinmarket-clientserver-0.9.2/jmbase/jmbase/__init__.py", line 13, in <module>
    from .twisted_utils import (stop_reactor, is_hs_uri, get_tor_agent,
  File "/home/nv01/joinmarket-clientserver-0.9.2/jmbase/jmbase/twisted_utils.py", line 5, in <module>
    from twisted.internet.endpoints import TCP4ClientEndpoint, UNIXClientEndpoint
  File "/home/nv01/joinmarket-clientserver-0.9.2/jmvenv/lib/python3.9/site-packages/twisted/internet/endpoints.py", line 395, in <module>
    class StandardErrorBehavior(Names):
  File "/home/nv01/joinmarket-clientserver-0.9.2/jmvenv/lib/python3.9/site-packages/constantly/_constants.py", line 160, in __new__
    cls = super(_ConstantsContainerType, self).__new__(
TypeError: 'Shiboken.ObjectType' object is not iterable

github12101 avatar Oct 02 '21 18:10 github12101

Just confirmed: wallet-tool.py and yg-privacyenhanced.py works ok in this installation, but joinmarket-qt.py doesn't.

github12101 avatar Oct 02 '21 19:10 github12101

Just to note that tested on aarch64 and it works but need to use the system-side packages for PySide2 and PyQt5 as pip doesn't have those on arm:

https://github.com/openoms/joininbox/blob/dbb4b945101ab48b4f5461ffc8bdeccc5951c0b8/scripts/install.joinmarket.sh#L100

openoms avatar Oct 02 '21 19:10 openoms

Is this a delta from 0.9.1, or some earlier version?

AdamISZ avatar Oct 03 '21 09:10 AdamISZ

Is this a delta from 0.9.1, or some earlier version?

Previously I've been using 0.8.3. So it's a jump 0.8.3 -> 0.9.2.

github12101 avatar Oct 03 '21 12:10 github12101

Just tried 0.9.0, downloaded it, installed and run exactly same steps as in the first post, but in 0.9.0 folder. Problem can be reproduced. So maybe it's a bug in 0.9.0, not present in 0.8.3.

(jmvenv) nv01@xx:~/joinmarket-clientserver-0.9.0$ python scripts/joinmarket-qt.py
Traceback (most recent call last):
  File "/home/nv01/joinmarket-clientserver-0.9.0/scripts/joinmarket-qt.py", line 58, in <module>
    from jmbase import get_log, stop_reactor
  File "/home/nv01/joinmarket-clientserver-0.9.0/jmbase/jmbase/__init__.py", line 13, in <module>
    from .twisted_utils import (stop_reactor, is_hs_uri, get_tor_agent,
  File "/home/nv01/joinmarket-clientserver-0.9.0/jmbase/jmbase/twisted_utils.py", line 5, in <module>
    from twisted.internet.endpoints import TCP4ClientEndpoint, UNIXClientEndpoint
  File "/home/nv01/joinmarket-clientserver-0.9.0/jmvenv/lib/python3.9/site-packages/twisted/internet/endpoints.py", line 395, in <module>
    class StandardErrorBehavior(Names):
  File "/home/nv01/joinmarket-clientserver-0.9.0/jmvenv/lib/python3.9/site-packages/constantly/_constants.py", line 160, in __new__
    cls = super(_ConstantsContainerType, self).__new__(
TypeError: 'Shiboken.ObjectType' object is not iterable

github12101 avatar Oct 03 '21 12:10 github12101

@github12101

The bug is in PySide2, see here. It seems that earlier versions of the module are incompatible with Python 3.8+ and Debian Bullseye ships with Python 3.9

This is a QT dependency, which explains why you encountered the bug only when trying GUI.

There are two possible solutions:

  • Downgrade your Python to 3.7
  • Install a more recent version of PySide2 (>=5.14 should fix the issue)

PulpCattel avatar Oct 14 '21 18:10 PulpCattel

@PulpCattel Thanks for your reply.

Downgrading Debian Bullseye to Python 3.7 is not possible, that would destroy the system.

I already have PySide >5.14 in Debian Bullseye.

$ dpkg -l | grep pyside ii libpyside2-py3-5.15 5.15.2-1 amd64 Python 3 bindings for Qt5 (base files) ii python3-pyside2.qtcore 5.15.2-1 amd64 Python bindings for Qt5 core module (Python 3) ii python3-pyside2.qtgui 5.15.2-1 amd64 Python bindings for Qt5 Gui module (Python 3) ii python3-pyside2.qtwidgets 5.15.2-1 amd64 Python bindings for Qt5 Widgets module (Python 3)

This pyside2, isn't is embedded in JoinMarket, as other python packages,which are being downloaded during install? It relies on my system pyside2?

github12101 avatar Oct 14 '21 20:10 github12101

Pyside2 requiremens for JM-QT is PySide2!=5.15.0,!=5.15.1,!=5.15.2,!=6.0 (see requirements/gui.txt), don't think there could be 5.13.x or lower for anybody with recent installs. OP also said he ran install.sh, so jmvenv should have been recreated with a new version.

kristapsk avatar Oct 14 '21 22:10 kristapsk

Downgrading Debian Bullseye to Python 3.7 is not possible, that would destroy the system.

You should be able to install Python 3.7 and then create a virtualenv that uses Python 3.7, though installing a new version of PySide seems surely easier.

I already have PySide >5.14 in Debian Bullseye.

Check the version inside the virtualenv (pip list or equivalent). The version from DPKG is 5.15.2, which is excluded by JoinMarket, so most likely you are not using that.

Pyside2 requiremens for JM-QT is PySide2!=5.15.0,!=5.15.1,!=5.15.2,!=6.0 (see requirements/gui.txt), don't think there could be 5.13.x or lower for anybody with recent installs.

I can reproduce the bug in a clean Debian Bullseye image, pip install -r downloads (IDK why) version 5.13.2

PulpCattel avatar Oct 14 '21 23:10 PulpCattel

(jmvenv) x@x:~/joinmarket-clientserver-0.9.2$ pip list | grep PySide2
PySide2           5.13.2

Why fail then? What should I do to not fail Qt building?

github12101 avatar Oct 15 '21 01:10 github12101

(jmvenv) pip install PySide2==5.1x.x

if you want a specific version. or:

(jmvenv) pip install "PySide2>=5.14"

PulpCattel avatar Oct 15 '21 02:10 PulpCattel

Thanks, that worked! Successfully installed PySide2-5.13.2 joinmarketbase-0.9.2 joinmarketbitcoin-0.9.2 joinmarketclient-0.9.2 joinmarketdaemon-0.9.2 joinmarketui-0.9.2 shiboken2-5.13.2 I selected "Directory jmvenv exists. Remove and recreate? (y/n) n" in the beginning just to be sure.

Any chance "PySide2>=5.14" version can be incorporated with JM? Looks like default version install.sh script have downloaded to virtualenv is bugged. As @PulpCattel has also reproduced.

github12101 avatar Oct 15 '21 08:10 github12101

Any chance "PySide2>=5.14" version can be incorporated with JM?

Sounds like a good idea to me, will look into that.

kristapsk avatar Oct 15 '21 08:10 kristapsk

If I recall correctly, one of a couple of reasons I didn't bother to build binaries for Qt for Linux (I actually used to do this, in 2016), was that disappointingly even a 'static' build ends up having dynamic dependencies that made it fail to work on some, even common, distros. The other reason was a lack of demand for it. Now there is an automated Windows build only, see #641 for how it's built with Wine.

Why do I mention that here? Because it's proved a continuous pain point to get the dependencies in the Qt app not to bork in this way. Apart from #1031 there was #737 and #865 and #913 as resolution to them (and earlier #739), and #815 (which was closed but unresolved?), about macOS, and then #702 about ARM, and #687. I'll stop here :)

I would ideally like an AppImage type workflow to actually work; especially if it could avoid any possibility of a dynamic dependency screwing things up (which I think AppImage should do?). Problem was, last time I checked about a year ago, I didn't find a simple packaging solution for AppImage that could work for us? The windows stuff shown above in #641 works with pyinstaller (and btw is not simple at all! but some of that is Windows).

AdamISZ avatar Oct 15 '21 15:10 AdamISZ

On Debian 11 amd64 I got:

(jmvenv) $ pip install "PySide2>=5.14"
ERROR: Could not install packages due to an OSError: [Errno 2] No such file or directory

To fix needed to edit the ~/joinmarket-clientserver/jmvenv/pyvenv.cfg to change to:

include-system-site-packages = true

Then:

$ pip3 install "PySide2>=5.14"
Successfully installed PySide2-5.15.2 shiboken2-5.15.2

openoms avatar Dec 17 '21 21:12 openoms

New update, new problem.

Downloaded 0.9.4 to separate folder unpacked ./install.sh run (jmvenv) (...):~/joinmarket-clientserver-0.9.4$ python scripts/joinmarket-qt.py wallet.jmdat TypeError: 'Shiboken.ObjectType' object is not iterable Fixed that by pip install "PySide2>=5.14" as instructed before:

Successfully installed PyQt5-5.15.6 PyQt5-Qt5-5.15.2 PyQt5-sip-12.9.0 PySide2-5.13.2 joinmarketbase-0.9.4 joinmarketbitcoin-0.9.4 joinmarketclient-0.9.4 joinmarketdaemon-0.9.4 joinmarketui-0.9.4 pillow-9.0.0 qrcode-7.3.1 qt5reactor-0+unknown shiboken2-5.13.2
Installing XDG desktop entry
Joinmarket successfully installed

Try again:

(jmvenv) (...):~/joinmarket-clientserver-0.9.4$ python scripts/joinmarket-qt.py wallet.jmdat
User data location: /home/xxx/.joinmarket/
Traceback (most recent call last):
  File "/home/xxx/joinmarket-clientserver-0.9.4/scripts/joinmarket-qt.py", line 2389, in <module>
    openWalletDialog = JMOpenWalletDialog()
  File "/home/xxx/joinmarket-clientserver-0.9.4/scripts/joinmarket-qt.py", line 116, in __init__
    self.setupUi(self)
  File "/home/xxx/joinmarket-clientserver-0.9.4/jmqtui/jmqtui/open_wallet_dialog.py", line 95, in setupUi
    self.retranslateUi(OpenWalletDialog)
AttributeError: 'JMOpenWalletDialog' object has no attribute 'retranslateUi'

github12101 avatar Jan 05 '22 00:01 github12101