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

Qt: Require PySide2>=5.14

Open kristapsk opened this issue 2 years ago • 13 comments

Resolves #1031.

kristapsk avatar Oct 15 '21 09:10 kristapsk

IDK why but I can't find any 5.14.x version, could it be that they do not have packages for Python 3.9?

(jmvenv) pip install --use-deprecated=legacy-resolver PySide2==
ERROR: Could not find a version that satisfies the requirement PySide2== (from versions: 0.0.0a1, 5.11.0, 5.11.1, 5.11.2, 5.12.0, 5.12.1, 5.12.2, 5.12.3, 5.12.4, 5.12.5, 5.12.6, 5.13.0, 5.13.1, 5.13.2, 5.15.1, 5.15.2)
ERROR: No matching distribution found for PySide2==

PulpCattel avatar Oct 15 '21 11:10 PulpCattel

Not sure, 5.14.x versions are in the release history. https://pypi.org/project/PySide2/#history

kristapsk avatar Oct 15 '21 13:10 kristapsk

Confirmed working on: Ubuntu 20.04 with Python 3.8.10

I'll see if I can reproduce the error on Python3.9.

AdamISZ avatar Nov 04 '21 14:11 AdamISZ

Reproduced on Ubuntu 20.04 with a python3.9 virtualenv:

ERROR: Could not find a version that satisfies the requirement PySide2!=5.15.0,!=5.15.1,!=5.15.2,!=6.0,>=5.14 (from versions: 0.0.0a1, 5.11.0, 5.11.1, 5.11.2, 5.12.0, 5.12.1, 5.12.2, 5.12.3, 5.12.4, 5.12.5, 5.12.6, 5.13.0, 5.13.1, 5.13.2, 5.15.1, 5.15.2)
ERROR: No matching distribution found for PySide2!=5.15.0,!=5.15.1,!=5.15.2,!=6.0,>=5.14

AdamISZ avatar Nov 04 '21 16:11 AdamISZ

Not sure, 5.14.x versions are in the release history. https://pypi.org/project/PySide2/#history

I believe what is going on here is that there are no wheels for Python3.9 for the 5.14* releases. See here:

https://download.qt.io/official_releases/QtForPython/pyside2/

Notice that there are *.whl files for 5.15.2 with names including cp39:

https://download.qt.io/official_releases/QtForPython/pyside2/PySide2-5.15.2-5.15.2-cp35.cp36.cp37.cp38.cp39-none-win_amd64.whl

whereas for 5.14.* they don't have them:

https://download.qt.io/official_releases/QtForPython/pyside2/PySide2-5.14.2.3-5.14.2-cp35.cp36.cp37.cp38-none-win_amd64.whl

AdamISZ avatar Nov 04 '21 16:11 AdamISZ

For 5.15 we require 5.15.3+ due to this bug.

So it looks it's currently impossible to have both #737 and #1031 fixed for Linux users with Python 3.9.

Possible solutions:

  1. use different version for Python 3.9, that re-introduces 737, could warn users;
  2. just warn users about potential problems if Python 3.9 under Linux is detected;
  3. look into possibilities of monkey patching solution for 737;
  4. do nothing for now, just wait.

kristapsk avatar Nov 04 '21 17:11 kristapsk

Indeed it's been 9 months since the last release and we need to wait on that for the fix. Maybe leave it for now, maybe (2) i.e. add a warning about it.

AdamISZ avatar Nov 04 '21 17:11 AdamISZ

Recently Arch and Manjaro updated to Python 3.10. So you will need to install Python 3.9, make the venv with Python 3.9, and then bump PySide2's version. After doing that the install script works fine. In the future, you likely won't have to downgrade your Python version.

5F43CCDF avatar Jan 12 '22 02:01 5F43CCDF

Hmm, https://pypi.org/project/PySide2/ says "Requires: Python >=2.7, !=3.0., !=3.1., !=3.2., !=3.3., !=3.4.*, <3.10", so there is no PySide2 available at all for Python 3.10?

kristapsk avatar Jan 12 '22 21:01 kristapsk

Tried with Python 3.10 on Gentoo (after emerging python:3.10, to which Gentoo seems to have defaulted too). First with current master:

$ ./install.sh --disable-secp-check --with-qt --python python3.10
...
$ source jmvenv/bin/activate
$ python --version
Python 3.10.0
$ python3.10 scripts/joinmarket-qt.py

image

With this PR :(

...
ERROR: Could not find a version that satisfies the requirement PySide2!=5.15.0,!=5.15.1,!=5.15.2,!=6.0,>=5.14 (from versions: 0.0.0a1, 5.11.0, 5.11.1, 5.11.2, 5.12.0, 5.12.1, 5.12.2, 5.12.3, 5.12.4, 5.12.5, 5.12.6, 5.13.0, 5.13.1, 5.13.2)
ERROR: No matching distribution found for PySide2!=5.15.0,!=5.15.1,!=5.15.2,!=6.0,>=5.14
Joinmarket was not installed. Exiting.

Houston, we have a problem!

kristapsk avatar Jan 13 '22 01:01 kristapsk

I'd just keep using python3.9 within that project, or else migrate to pyside6.

I'm willing to bet that is because there isn't a pyside2 wheel for python 3.10; you will either have to install pyqt5 (which I think has python 3.10 wheel) or pyside6

https://www.reddit.com/r/QtFramework/comments/rpzhqe/old_version_of_pyside2_since_update_of_python_39/

Now you have two options:

  1. Try installing from source by following the official docs (I would not recommend this for a beginner)
  2. Uninstall python 3.8 and install 3.7 instead or use a virtual environment with python 3.7 (I would recommend this, since you most likely don't rely on the difference between python 3.8 and 3.7)

https://stackoverflow.com/a/58744936/1356754 (looks like this issue happened during the python 3.8 upgrade too)

I can get version 5.15.2 for Python 3.10 using pacman, but using pip I can only get 5.13.2 unless I downgrade my Python to 3.9. If I do that, I can use pip to install 5.15.2 again.

5F43CCDF avatar Jan 13 '22 05:01 5F43CCDF

I'm trying to do a PR to migrate to PySide6, but currently I'm stuck with this error:

$ ./scripts/joinmarket-qt.sh 
User data location: /home/user/.joinmarket/
2022-01-14 12:54:53,476 [DEBUG]  rpc: getblockchaininfo []
2022-01-14 12:54:53,478 [DEBUG]  rpc: listwallets []
Traceback (most recent call last):
  File "shibokensupport/signature/mapping.py", line 196, in update
  File "shibokensupport/signature/mapping.py", line 197, in <genexpr>
  File "shibokensupport/signature/mapping.py", line 182, in module_valid
  File "/home/user/git/joinmarket-clientserver/jmvenv/lib/python3.8/site-packages/chromalog/mark/helpers.py", line 63, in __getattr__
    raise AttributeError(name)
AttributeError: __name__
Fatal Python error: seterror_argument failed to call update_mapping
Python runtime state: initialized

Current thread 0x00007f9fc26e9740 (most recent call first):
  File "/home/user/git/joinmarket-clientserver/jmqtui/jmqtui/open_wallet_dialog.py", line 22 in setupUi
  File "joinmarket-qt.py", line 116 in __init__
  File "joinmarket-qt.py", line 1983 in openWallet
  File "joinmarket-qt.py", line 2440 in <module>
./scripts/joinmarket-qt.sh: line 5: 20084 Aborted                 python3 joinmarket-qt.py

Can open draft PR if somebody else have ideas how to solve this.

kristapsk avatar Jan 14 '22 10:01 kristapsk

Hmm, https://pypi.org/project/PySide2/ says "Requires: Python >=2.7, !=3.0., !=3.1., !=3.2., !=3.3., !=3.4.*, <3.10", so there is no PySide2 available at all for Python 3.10?

Seems that it has changed to <3.11 :

https://pypi.org/project/PySide2/

Requires: Python >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, <3.11

AdamISZ avatar Apr 19 '22 12:04 AdamISZ