Newer psychopy versions causes my experiment to crash

Hi there,
I designed my experiment in psychopy 2022.2.4 and it worked perfectly as intended. Now that the computer in the lab has been updated to the newer version, the experiment does not work anymore - lab computer is not connected to the internet so I cannot change version of Psychopy.
In my “old” experiment, this code works perfectly:
main_movie = visual.MovieStim(
win, name=‘main_movie’,
filename=None, movieLib=‘ffpyplayer’,
loop=False, volume=1.0,
pos=(0, 0), size=1.0, units=‘pix’,
ori=0.0, anchor=‘center’,opacity=1.0, contrast=1.0,
)
main_movie.setSize((1920, 1080))
main_movie.setMovie(‘video/Main_Video.mp4’)

Now, it gives a RuntimeError: Calling this class method requires a successful call to load first.
Can anyone please help?

Try main_movie.loadMovie() instead of setMovie(). There’s a check as to whether a movie file is already loaded in setMovie, but in the end all it does is call loadMovie anyway, and there’s no reason you can’t call loadMovie directly.

Hi Jonathan,
Thank you! I figured it out 20 minutes after I posted it :smiley: You were right, this is the updated code:
main_movie = visual.MovieStim(
win, name=‘main_movie’,
filename=None, movieLib=‘ffpyplayer’,
loop=False, volume=1.0,
pos=(0, 0), size=1.0, units=‘pix’,
ori=0.0, anchor=‘center’,opacity=1.0, contrast=1.0,
)
main_movie.load(‘video/Main_video.mp4’)
main_movie.setSize((1920, 1088))
main_movie.setMovie(‘video/Main_video.mp4’)