Instructing PsychoPy to use a different Version of Python

Hello,

I am trying to reuse older PsychoPy experiments, that were made with Version 2021.1.4.
I can open the .psyexp files, but when I try to Run them I get this error:

OSError: Requested PsychoPy version 2021.1.4 does not support installed Python version 3.8. The first version of PsychoPy to support 3.8 was version 2022.1.0.

Try either choosing a different version of PsychoPy or installing a different version of Python - some standalone PsychoPy releases include installers for multiple versions.

So I installed Python 3.7.9. Now I have two installs of Python on my PC. But I still get the same error message. I assume that is because PsychoPy still tries to use Python 3.8.

Can I tell PsychoPy to use Python 3.7.9 instead?
Or do I have to uninstall both Versions and find an installer that installs both versions I want at once?

Btw my OS is Windows 10 and installed Python and PsychoPy over their respective .exe installers.

If you wanna know why I don’t run the files with Version 2022.1.0, that is because I get an error message regarding code elements. Since those experiments used to work I assume this is a fault with using the Version 2022.1.0. I am trying to use the original experiments as much as possible, if only because the person who programmed the custom code for those experiments was a much better programmer than I am and I would most likely need a lot more time to learn what he did and fix it, rather than just getting the right version of PsychoPy to work.

If you are using the app, it comes with its own internal version of Python, which is completely independent of system python and can’t be changed.

You can just download PsychoPy 2021.1.4 to run these specific experiments, and it will have the right version of python. That’s the fast solution. If you want a more in-depth solution you’ll need to share the experiment and the errors you’re getting.

1 Like

Okay, let’s delve in then.

This is the experiment I am talking about: Sign in ¡ GitLab
It is supposed to be hosted on Pavlovia and only run Online.

As far as I know the experiment was originally created with PsychoPy 2020.2.10

When I opened the .psyexp under ‘Properties’ it was set to use PsychoPy Version 2021.1.4. Because it was first reused back then.

But with this version I can’t run the experiment or sync it with Pavlovia, because I get the error message:
OSError: Requested PsychoPy version 2021.1.4 does not support installed Python version 3.8. The first version of PsychoPy to support 3.8 was version 2022.1.0.

So I switch to use PsychoPy Version 2022.1.0. Then I can run the experiment and sync it to Pavlovia. However running it locally ends in an error message because it has Code Elements with JavaScript.
After synching it to Pavlovia, it tells me in the dashboard that the experiment uses the Platform “Unknown” and Version “0”.
When I click on Pilot I am stuck at “initialising experiment…” and the Web-Dev tools tells me it is because:

Laden des Moduls von "https://run.pavlovia.org/Adsecularis/leson7r_b_no_test/html/LESON7R_b_no_legacy.js" wurde auf Grund eines nicht freigegebenen MIME-Typs ("text/html") blockiert.

Loosely translated, it can’t load the JavaScript because of an unauthorised MIME-Type. No idea what that means.

When I switch to use no particular version, thereby choosing 2024.2.2, the actual version of the PsychoPy program I have installed, I can sync to Pavlovia and Pavlovia displays the correct Platform (PsychoJS) and Version (2024.2.2).
Then I can get past the initialisation but get immediately hit with the Unknown Resource Error.

The pictures are set to change every repeat and which picture to display is written in .xslx files.
But I also put my own default.png into the experiment folder. I included every used picture under Properties → Online → Additional Resources. And the very first routine in the experiment is a routine with noting but a Resource Manager that is supposed to check that every resource is loaded before starting.

So what is even the issue here?

EDIT:

I seemingly got past it all by downloading PsychoPy 2021.1.4
Now I can initialise the experiment and start it. So, atleast I can work on the experiment with the old PsychoPy version.
But running it locally just causes PsychoPy to freeze indefinitely.

OK. So, to clarify a couple things, the underlying code of the online version that runs in a web browser is JavaScript, while when you run it locally the underlying code is in Python (unless you are using the JS button to test it locally in your web browser). So, if you are trying to run it as a python experiment locally and it’s not working, that’s not necessarily a cause for concern if the experiment is running online in the end.

The ‘default.png not found’ error is odd in that adding a file of that name usually fixes it. The fact that it didn’t in this case makes me wonder if it was an issue with it having trouble syncing to the Pavlovia repository.

In any case since you have a working version that’s good enough for now.