Experiment script will not run: OSError: [Errno 22] Invalid argument

OS (e.g. Win10): Win 10
PsychoPy version (e.g. 1.84.x): 2020.1.3
Standard Standalone? (y/n) If not then what?: y
What are you trying to achieve?: run experiment script

What did you try to make it work?: Run script in Python

What specifically went wrong when you tried that?:

Error message

Traceback (most recent call last):
  File "C:\Program Files\PsychoPy3\lib\site-packages\psychopy\scripts\psyexpCompile.py", line 74, in generateScript
    compileScript(infile=exp, version=None, outfile=filename)
  File "C:\Program Files\PsychoPy3\lib\site-packages\psychopy\scripts\psyexpCompile.py", line 245, in compileScript
    _makeTarget(thisExp, outfile, targetOutput)
  File "C:\Program Files\PsychoPy3\lib\site-packages\psychopy\scripts\psyexpCompile.py", line 236, in _makeTarget
    f.write(scriptText)
OSError: [Errno 22] Invalid argument
## Running: D:\[directory]/[filename.py] ##
##### Experiment ended. #####

Welcome to PsychoPy3!
v2020.1.3
4489.2069     WARNING     IPython failed as shell, using pyshell (IPython v0.12 can fail on wx)
Welcome to PsychoPy3!
v2020.1.3
4498.9833     WARNING     IPython failed as shell, using pyshell (IPython v0.12 can fail on wx)
Welcome to PsychoPy3!
v2020.1.3
4504.4382     WARNING     IPython failed as shell, using pyshell (IPython v0.12 can fail on wx)

Additional info:

The experiment was originally programmed in v3.2.4. I copied the folder to a new laptop running 2020.1.3. It ran fine. I then had to copy across again due to a mixup that resulted in over-writing the directory… This time however the error above occurs.

So you switched from v3.2 to v2020.1.3 and then back to v3.2?
Even if your experiment worked with v2020.1.3 coming from v3.2 because of backwards compatibility, I don’t think Psychopy is forwards compatible. If you used new features of v2020.1.3, the v3.2 version may not “know” what to do with them.

Hi, thanks for the reply. Not quite, I copied the experiment folder from a laptop running 3.2.4 to a laptop running 2020.1.3. I had to do this twice, and on the second occasion it failed to run in 2020.1.3

Did you copy the .psyexp file? Can you open the .psyexp file in the builder interface? Can you compile the script (probably not because that is the error you get when you try running it, but it may be worth trying)?

Can you compile and/or run your script if you select the v3.2.4 version with the Use Psychopy Version option?

Yes copied the .psyexp file and can open it in the builder interface. The error occurs when I run experiment from there.

I have now rewritten the experiment from scratch in v.2020 - time consuming but it now works at least!

1 Like