rez
rez copied to clipboard
[Windows] PySide2 not working with Python-3.8+
Platform: Windows 10
Rez version: 2.103.4
This issue is not Rez-dependent but this is strongly related to its way of working (separated packages).
TL;DR
As far as I know, the use of PySide2
with Python-3.8+
via Rez
seems impossible on Windows.
Description
I recently installed Rez
on my Windows 10 computer. To follow the VFX Platform recommendations, I wanted to work with Python-3.9
and PySide2-5.15
.
After installing PySide2
(and its dependency shiboken2
) via rez-pip
, I tried to run a Python shell and to import PySide2
.
I instantly got an exception coming from the PySide2\__init__.py
file. Actually, as we can see in the code right here, when using Python-3.8+
, the file tries to deal with relative paths from PySide2
to find the shiboken
directory and, because it does not find it, it raises this exception.
I am not sure this is the good place to talk about this but I thought it was quite relevant to notice.
Had and still have the same problem. By now I've just moved shiboken2 in the PySide2 package to make it work, but of course I'm not happy with it.
If you're using python 3.8, I highly suggest you update to python 3.9+ to follow the VFX platform. Now the PySide2 problem: I've seen this too, and the only way I found to fix it is to copy the shiboken2 module to the python directory in the PySide2 package. So you'll have:
...\packages\ext\PySide2\5.15.2.1\<variants>\python
PySide2
shiboken2
It's not ideal, but the shiboken2 module is fairly small and this has worked for me. Just make sure you copy the correct version of shiboken2.