DavidoTek / ProtonUp-Qt

Install and manage GE-Proton, Luxtorpeda & more for Steam and Wine-GE & more for Lutris with this graphical user interface.
https://davidotek.github.io/protonup-qt
GNU General Public License v3.0
1.16k stars 39 forks source link

Change AppImage PYTHONPATH to local lib #392

Closed DavidoTek closed 1 month ago

DavidoTek commented 1 month ago

Fix https://github.com/DavidoTek/ProtonUp-Qt/issues/390

Change PYTHONPATH from ${APPDIR}/usr/lib/python3.10/site-packages to ${APPDIR}/usr/local/lib/python3.10/dist-packages.

I need to check whether that really fixes it, marked as draft for now.

sonic2kk commented 1 month ago

If you need me to test anything here I'd be happy to see if it resolves the issue for me. I still have my python3.10 packages specifically in case a fix needed testing :smile:

You might need to hold my hand a little with the instructions but I'll test however I can :-)

DavidoTek commented 1 month ago

Good to know, thanks.

I'm still not 100% sure what the issue is. I tried to build the AppImage locally using my Ubuntu 22.04 Distrobox and Python 3.10.14 Conda environment, but the paths are different to the GitHub Runner (uses Python 3.10.12):

$ ./ProtonUp-Qt-2.9.2-x86_64.AppImage --appimage-extract  # from GitHub releases
$ cd squashfs-root
$ find | grep -i PySide6/ | head -n 1
./usr/local/lib/python3.10/dist-packages/PySide6/PySide6_Essentials.json

$ ./ProtonUp-Qt-TestBuildPR.AppImage --appimage-extract  # local build from this PR
$ cd squashfs-root
$ find | grep -i PySide6/ | head -n 1
./usr/lib/python3.10/site-packages/PySide6/PySide6_Essentials.json

EDIT: That is probably caused by a patched Python version of the distros as I mentioned in https://github.com/DavidoTek/ProtonUp-Qt/issues/378#issuecomment-2071492202. https://discuss.python.org/t/linux-distro-patches-to-sysconfig-are-changing-pip-install-prefix-outside-virtual-environments/18240 also says:

Normally, when you do a pip install --prefix /tmp/foo sampleproject, you get a file system tree that looks like: [...] /tmp/foo/lib/python3.9/ However, when using the Linux-distro-provided Python, outside of a virtual environment, we get: [...] /tmp/foo/local/lib/python3.9/

That explains why the Conda environment doesn't use the local path. I tested also with the included Python 3.11 of the Distrobox, but that also didn't install in the local path, not sure why.


Assumed that we keep building using Ubuntu and the patch isn't removed, this PR should work. We should reevaluate it eitherway when we have to bump the build system again in the future.