PsychoPy will not open on Windows 10

I installed a stand-alone version of the most recent version of PsychoPy (2022.2.5) from Installation — PsychoPy v2022.2.5, but it will not open. If I try to open the application from the start menu, or try to open an existing experiment file, I see the splash screen and then nothing. I have tried to re-install PsychoPy multiple times, always with the same result.

I believe that the most common fix for this problem is to delete the userPrefs.cfg and/or appData.cfg files from the %appData% folder, however neither file exists in this folder on my computer (see screenshot):

I tried running "C:\Program Files\PsychoPy\python.exe" -m psychopy.app.psychopyApp" in a command window. This causes the splash screen to appear and then disappear, and no error message appears (the command line resets as if the command has been fully executed).

I’d be very grateful for any advice!

Okay, the solution to this one was weird. I opened up the “Last_app_load” text document and saw an error related to PortAudio (apologies, I did not copy the error and it has since been overwritten). I’ve seen this error before when PsychoPy opens normally, but on a whim I tried plugging in a speaker. Somehow that fixed the problem - once the speaker was plugged in, PsychoPy opened just fine. I guess it was breaking because it could not detect an audio device?

Anyway, I’m leaving this here in case it helps anyone in the future.

3 Likes

Thank you - This solved my problem i.e. I can only open the PsychoPy standalone when I plug in a speaker. I add the “Last_app_load” text document below:


1.3369 DEBUG Opening message catalog C:\Program Files\PsychoPy\lib\site-packages\psychopy\localization..\app\locale\en_US\LC_MESSAGE\messages.mo for locale en_US
pygame 2.1.0 (SDL 2.0.16, Python 3.8.10)
Hello from the pygame community. Contribute - pygame wiki
PTB-INFO: Using modified PortAudio V19.7.0-devel, revision unknown
Error in function GetDevices: Usage error
PTB-ERROR: PortAudio can’t detect any supported sound device on this system.
PsychPortAudio:GetDevices: Usage:

devices = PsychPortAudio(‘GetDevices’ [, devicetype] [, deviceIndex]);
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\app\psychopyApp.py”, line 102, in
main()
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\app\psychopyApp.py”, line 98, in main
start_app()
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\app\psychopyApp.py”, line 26, in start_app
app = startApp(showSplash=showSplash)
File "C:\Program Files\PsychoPy\lib\site-packages\psychopy\app_init
.py", line 85, in startApp
psychopyApp = PsychoPyApp(
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\app_psychopyApp.py”, line 232, in init
self.onInit(testMode=testMode, **kwargs)
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\app_psychopyApp.py”, line 376, in onInit
from psychopy.app import coder, builder, runner, dialogs
File "C:\Program Files\PsychoPy\lib\site-packages\psychopy\app\builder_init
.py", line 5, in
from .builder import BuilderFrame
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\app\builder\builder.py”, line 123, in
class BuilderFrame(BaseAuiFrame, handlers.ThemeMixin):
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\app\builder\builder.py”, line 126, in BuilderFrame
routineTemplates = TemplateManager()
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\app\builder\builder.py”, line 108, in init
self.updateTemplates()
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\app\builder\builder.py”, line 115, in updateTemplates
thisExp = experiment.Experiment()
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\experiment_experiment.py”, line 136, in init
settingsComp = getComponents(fetchIcons=False)[‘SettingsComponent’]
File "C:\Program Files\PsychoPy\lib\site-packages\psychopy\experiment\components_init
.py", line 154, in getComponents
module = import_module(explicit_rel_path, package=pkg)
File "C:\Program Files\PsychoPy\lib\importlib_init
.py", line 127, in import_module
return _bootstrap.gcd_import(name[level:], package, level)
File "C:\Program Files\PsychoPy\lib\site-packages\psychopy\experiment\components\microphone_init
.py", line 24, in
devices = {d.deviceName: d for d in Microphone.getDevices()}
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\sound\microphone.py”, line 548, in getDevices
allDevs = audio.get_devices(device_type=13)
File “C:\Program Files\PsychoPy\lib\site-packages\psychtoolbox\audio.py”, line 70, in get_devices
return PsychPortAudio(‘GetDevices’, device_type, device_index);
Exception: PTB-ERROR: PortAudio can’t detect any supported sound device on this system.
39.5314 INFO Loaded SoundDevice with PortAudio V19.7.0-devel, revision 147dd722548358763a8b649b3e4b41dfffbcfbb6
39.5315 INFO sound is using audioLib: sounddevice
39.5315 WARNING We strongly recommend you activate the PTB sound engine in PsychoPy prefs as the preferred audio engine. Its timing is vastly superior. Your prefs are currently set to use [‘sounddevice’, ‘PTB’, ‘pyo’, ‘pygame’] (in that order).

You save my day ! It worked for me too.
After multiple re installation I saw your message. I just plugs earphones in my computer and it opened !
Very weird but works :slight_smile:

Plugging the speakers worked for me as well. Thanks!

If it still doesn’t work after plugging the headphones, another temporary fix is to install it and launch it from a python virtual environment: venv — Creation of virtual environments — Python 3.12.2 documentation , using pip install
Anaconda should work also I think.