I have reviewed some similar issues:
which seemed to be provoked by using the wrong version of PsychoPy. I verified that I unpacked the 2023.2.0 demos.
I also tried with 2023.1.3: I unpacked the demos for that version, and ran the gratings demo. I get the same error:
Are there any other versions I should try?