Experiments not working following psychopy upgrade

If this template helps then use it. If not then just delete and start from scratch.

OS (e.g. Win10): Win 10
PsychoPy version (e.g. 1.84.x): 2021.2.3 ->2023.2.2
Standard Standalone? (y/n) If not then what?: y
What are you trying to achieve?:
My lab downloaded the most recent version of psychopy to integrate with tobii eye tracker (we also kept the older version from 2021). This changed some features of data files in our experiments that were built using the older version of builder (e.g. adding brackets to data collected from mouse clicks). Trying to troubleshoot this, we opened one of the experiment files from the newer psychopy version, after which we could no longer get it to work.
We got errors related to cedrusBox component package failing to load and not having init.py. None of our experiments have a cedrus box component. This was followed by many warnings pertaining to unknown parameters (see below). Also, I want to mention that a new recently programmed experiment that was running fine on a laptop and got transferred to the desktop with a new version of psychopy also failed to run with the same error message. There is no cedrus component in that experiment either.

First experiment error:
NameError: name ‘instructions_2’ is not defined
################ Experiment ended with exit code 1 [pid:18636] #################
44.9135 ERROR Failed to load component package cedrusBox. Does it have a __init__.py?
44.9224 ERROR Failed to load component package cedrusBox. Does it have a __init__.py?
44.9239 WARNING Parameter ‘backgroundFit’ is not known to this version of PsychoPy but has come from your experiment file (saved by a future version of PsychoPy?). This experiment may not run correctly in the current version.
44.9536 WARNING Parameter ‘backgroundImg’ is not known to this version of PsychoPy but has come from your experiment file (saved by a future version of PsychoPy?). This experiment may not run correctly in the current version.
44.9633 WARNING Parameter ‘color’ is not known to this version of PsychoPy but has come from your experiment file (saved by a future version of PsychoPy?). This experiment may not run correctly in the current version.
44.9730 WARNING Parameter ‘colorSpace’ is not known to this version of PsychoPy but has come from your experiment file (saved by a future version of PsychoPy?). This experiment may not run correctly in the current version.

Second experiment error:
UnboundLocalError: local variable ‘visual’ referenced before assignment
################ Experiment ended with exit code 1 [pid:16528] #################
82.4072 ERROR Failed to load component package cedrusBox. Does it have a __init__.py?
82.4160 ERROR Failed to load component package cedrusBox. Does it have a __init__.py?
82.4209 INFO Loaded monitor calibration from [‘2020_11_05 15:33’]

What did you try to make it work?:
We tried changing the psychopy version in the Settings but to no avail.

What specifically went wrong when you tried that?:
Traceback (most recent call last):
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\app\builder\builder.py”, line 1277, in runFile
self.app.runner.panel.runLocal(event)
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\app\runner\runner.py”, line 751, in runLocal
generateScript(experimentPath=currentFile.replace(‘.psyexp’, ‘_lastrun.py’),
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\scripts\psyexpCompile.py”, line 82, in generateScript
raise LegacyScriptError(
psychopy.scripts.psyexpCompile.LegacyScriptError: Error: Script compile exited with code 1. Traceback:
C:\Program Files\PsychoPy\lib\site-packages\numpy_distributor_init.py:30: UserWarning: loaded more than 1 DLL from .libs:
C:\Program Files\PsychoPy\lib\site-packages\numpy.libs\libopenblas.PYQHXLVVQ7VESDPUVUADXEVJOBGHJPAY.gfortran-win_amd64.dll
C:\Program Files\PsychoPy\lib\site-packages\numpy.libs\libopenblas64__v0.3.21-gcc_10_3_0.dll
warnings.warn(“loaded more than 1 DLL from .libs:”
Traceback (most recent call last):
File “C:\Program Files\PsychoPy\lib\runpy.py”, line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File “C:\Program Files\PsychoPy\lib\runpy.py”, line 87, in _run_code
exec(code, run_globals)
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\scripts\psyexpCompile.py”, line 231, in
compileScript(args.infile, args.version, args.outfile)
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\scripts\psyexpCompile.py”, line 220, in compileScript
version = _setVersion(version)
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\scripts\psyexpCompile.py”, line 119, in _setVersion
useVersion(version)
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\tools\versionchooser.py”, line 197, in useVersion
ensurePythonCompatibility(requestedVersion)
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\tools\versionchooser.py”, line 262, in ensurePythonCompatibility
raise EnvironmentError(_msg.format(mode=“first”, key=firstVersion))
OSError: Requested PsychoPy version 2021.2.3 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.

!!! We have python 2 also running on that computer
Any help resolving this issue would be appreciated!!

1 Like

I have had some similar error messages while trying to upgrade from 2021.1.4 to 2023.2.3… no perfect solution yet to get me all the way to the newest version, but I’ve found that for whatever reason v2022.1.0 will at least start the experiment. I’d be curious if it works for you too.

Even though 2022.1.0 works for the most part, there are some idiosyncrasies, like some objects being displaced relative to their original location (Moved to top or top right of screen) and the mouse component is pretty unusable on a Mac locally. In addition, with the change of python version, you may want to look at any code components you have to make sure they are still behaving as expected.

Same issue. Going to downgrade to see if that does the trick.

Good luck!
FYI I just encountered the mouse component issues for another experiment in 2022.1.0-- I got that experiment to work in 2022.2.3 instead. So that might be another version to try, especially if you have clickable stimuli.