Provide Flatpak app?

Installing PsychoPy on Windows and macOS is pretty straightforward, because there are standalone installers for these platforms. However, installing PsychoPy on Linux has been rather difficult, and this topic has been brought up several times here and on GitHub. I just wanted to mention that Flatpak could very well be the solution to all Linux installation-related problems. PsychoPy could be installed on dozens of Linux distributions and would “just work”.

Note that I am aware that creating a Flatpak is probably a decent amount of work, so someone needs to find the time to do it. But given that Linux has many advantages over Windows (such as being open-source, more lightweight, having control over background processes, etc.), maybe this could be a worthwile undertaking (the official Python building guide could be a good starting point).

1 Like

Thanks for the headsup @cbrnr

With similar hopes, thoughts and desires we tried (and failed) with Snap. My recollection of the issue was to do with snap packaging particular versions of the libs (notably those used by wxpython) and these were often not compatible with the system on which the snap was installed.

So I guess the question is how far Flatpack differs from Snap. And the biggest issue is likely to be getting wxpython to package correctly

In the meantime, the good news for linux users is that

  1. PsychoPy code is now fully operational with Py 3.10 (which is what ubuntu now packages) so all you need to do is create a venv and the python is ready
  2. wxpython does ship with wheels for Py3.10 and most flavours of linux (but you need to fetch it from the URL before installing)
  3. we moved a fair amount of functionality out to plugins so that the “required” dependency list is shorter (if I recall that’s something you wanted)
1 Like

I don’t have any experience with Flatpak, but from what I’m hearing it’s what all distributions (except Ubuntu) have adopted, and it seems to be working pretty great. I’d expect that different versions should be supported via runtimes, but someone would have to actually try that.

It’s great to hear that PsychoPy works with pip, and BTW, I’ve also had success running it on Python 3.11 (the default Python in many distributions). And yes, I was strongly in favor of outsourcing functionality - very nice :rocket: :muscle:!

I’ve actually found a way to avoid having to download and install the appropriate wxpython wheel if you use --system-site-packages when creating the venv. I think this makes the whole process even easier, because system wxpython (installed via apt/dnf/pacman/…) will automatically be picked up by the venv:

  1. Install wxpython with system package manager
  2. Create venv with --system-site-packages
  3. Inside venv, pip install psychopy

Optionally, some systems might need specific packages like mesa-libGLU and libX11-devel on Fedora, but this is not too hard to find out (and in many cases, all packages are already installed).

In any case, a Flatpak app would be equivalent to the Windows and macOS stand-alone installers, so maybe still worth a try, because it will work without any additional steps by the user.

I just tried installing on an ubuntu VM with sudo apt install python3-wxgtk4.0. One issue is that this is out of date (wxpython is now v 4.2.1) and also it seems not to have support for the wx.html2 module which we need.
It feels like downloading the wheel manually for the specific linux flavour, and installing that, is the better approach for now

Yeah, I don’t use Ubuntu. Arch and Fedora have current packages which also support wx.html2.

Edit: And wx.html2 support for Ubuntu is available in libwebkit2gtk (or some similar name, not entirely sure). But yes, pip installing the wheels from wx is also pretty easy!

I am currently working on a flatpak for PsychoPy and managed to get a repo working. It seems to work on every Distro I tried. I don’t know the best way to distribute it so I was wondering if there is a way to distribute it on the official site (once you checked it out of course).

2 Likes

This is great news @huppfi! The best way to distribute your package would be on Flathub.

That’s great news.

Perhaps a good option would be for you to host it on Github or Flathub and then email the details to consultancy@opensciencetools.org with a view to having a link to it added to Installation — PsychoPy v2023.2.3

That is great news indeed. Well done! Yes, we’d like to test this and let’s grab a chat about next steps (distribution) and limitations (if there are any)

You have made my day with this news huppfi. I have been trying to install psychopy 2023.2.3 on Fedora 39 for the last month and it has been impossible. A Flatpak certainly would be a game-changer for everybody. Thanks!

Sorry for the delayed Response I was on holiday until now.

Alright I will host it on Flathub and then email you. Thank you!

1 Like

Is the email to consultancy@opensciencetools.org enough or should I contact you somewhere else?

I’ll message you directly. Many thanks!