PsychoPy Won't Run

Hello,

I recently had to factory reset my computer (running Windows 10). Before the factory reset, I had an experiment that was running fine locally, and had been using PsychoPy for several months with no problems like this. However, when I redownloaded PsychoPy and tried to run this experiment locally (it’s not yet synced to anything online), I got the following error message.

Running: C:\Users\willa\Documents\containment_exp\forcedchoice\forcedchoice_exp_lastrun.py

Traceback (most recent call last):
File “C:\Users\willa\Documents\containment_exp\forcedchoice\forcedchoice_exp_lastrun.py”, line 19, in
from psychopy import sound, gui, visual, core, data, event, logging, clock, colors
File “C:\Program Files\PsychoPy3\lib\site-packages\psychopy\gui_init_.py”, line 45, in
from .qtgui import *
File “C:\Program Files\PsychoPy3\lib\site-packages\psychopy\gui\qtgui.py”, line 35, in
from PyQt5 import QtWidgets
ImportError: DLL load failed: The specified procedure could not be found.

Experiment ended.

This happens in the standalone Windows downloads for both PsychoPy v2021.2.4 and PsychoPy v.2021.1.2 (the previous version I was running, which I downloaded in hopes that maybe the older version would work). It also happens when I try to locally run an older experiment that I know should work, because that experiment was launched on Pavlovia. The qtgui.py file is present in the program files:

It seems that some other users 1 2 have encountered this error before in October/November 2021, but both times the fix involved Anaconda, which I have no clue at all how to use.

Not quite sure what’s happening. Any advice would be greatly appreciated.

Update… finally figured out how to download and run through Anaconda, but now I’m getting another new error.

Traceback (most recent call last):
File “C:\Users\willa\Documents\containment_exp\forcedchoice\forcedchoice_exp_lastrun.py”, line 19, in
from psychopy import sound, gui, visual, core, data, event, logging, clock, colors
File “C:\Users\willa\Anaconda3\envs\env1\lib\site-packages\psychopy\sound_init_.py”, line 46, in
from .audioclip import * # import objects related to AudioClip
File “C:\Users\willa\Anaconda3\envs\env1\lib\site-packages\psychopy\sound\audioclip.py”, line 27, in
import soundfile as sf
ModuleNotFoundError: No module named ‘soundfile’
Alert 4405:Editable textbox component textbox_2 and keyboard component key_resp_10 in the same routine may compete for keypresses
For further info see 4405: Textbox and keyboard conflict — PsychoPy v2021.2.4

Experiment ended.

I’m not sure whether the ModuleNotFoundError or the Alert 4405 is keeping the experiment from running locally, but something is.

Hello wlane,

the alert only informs you that you have a keyboard-component and an editable textbox in one routine which can be ok.
The error informs you that there is no module soundfile. Do you use sound in your experiment?

Best wishes Jens

Hi Jens,

Thanks for your reply. I do not use sound at any point in my experiment, which makes this error very confusing. It appears that it is trying to load all potential modules before the experiment begins. I’m not sure how to tell it that I don’t need the sound file module.

Thank you!

Hello,

can you run any of the demo-experiments? Perhaps your installation is still not yet ok.

Best wishes Jens

1 Like

Hello Jens,

Thank you so much for your time. I wasn’t able to run any of the demo-experiments. However, the program is now working locally. Here is what I did to achieve this for anybody reading in the future.

I uninstalled Anaconda/Miniconda to remove Python, then search in the start menu for ANY files named python. There was a folder (pre-installed when I factory reset?) called Windows-Programs or something similar that contained a corrupted version of Python along with some Xbox stuff. I didn’t need anything in the folder, and the corrupted Python would not let me delete it on its own, so I deleted the entire folder. I then redownloaded the latest standalone version of PsychoPy. It seems that the corrupted file was causing the issue somehow, because now my experiments will run.

Sorry to bump. Clean installs of Psychopy 2021.2.3 and PsychoPy 2021.1.2 on a completely new computer (ASUS VivoBook running Windows 10) are now throwing the same error I detailed in my initial message:

‘’’## Running: C:\Users\willa\Downloads\willa_forcedchoice_demo-master\forcedchoice_exp_lastrun.py ##
Traceback (most recent call last):
File “C:\Users\willa\Downloads\willa_forcedchoice_demo-master\forcedchoice_exp_lastrun.py”, line 19, in
from psychopy import sound, gui, visual, core, data, event, logging, clock, colors
File “C:\Program Files\PsychoPy3\lib\site-packages\psychopy\gui_init_.py”, line 45, in
from .qtgui import *
File “C:\Program Files\PsychoPy3\lib\site-packages\psychopy\gui\qtgui.py”, line 35, in
from PyQt5 import QtWidgets
ImportError: DLL load failed: The specified procedure could not be found.

Experiment ended. #####’’’

There isn’t a corrupt version of Python this time around as far as I can tell, and the experiment was running fine earlier today. The problem started after I tried to upload to Pavlovia and sync the experiment. I deleted the lastrun.py file, the .gitignore file and .git folder, and everything out of the data and html folders (leaving html/resources intact).

No clue how to fix. Again, any help is much appreciated.

So sorry to ping you @jon but I feel like I’ve tried everything and I’m running out of ideas here.

You noted above the issue posted on Github about this. That issue got closed because it looked like a problem with Anaconda and I’m afraid none of the team have yet been able to replicate the issue on a range of computers (with and without existing Python installations).

I’m still at a loss as to what the issue could be, if it isn’t to do with Anaconda installing broken PyQt libraries. Maybe check your windows Path (environment variable) to check for other Python installations but if you say this is now on a clean computer then that seems unlikely and I’m at a loss to know why a very small number of people have this issue and 1000s of users don’t :thinking:

If anyone else has any ideas I’d love to hear them too! :slight_smile: