Python programs referencing pygame terminate with an error when being run in Thonny on Macs with arm processors (M-family of chips).
A workaround is to execute python files using the Terminal app on your Mac instead of running it through Thonny. Follow the steps below to run your .py file using a Terminal:
- Press Cmd+Space Bar on your Mac and search for the 'Terminal" app. Terminal opens up in your User folder by default
- Navigate to the folder with the .py file to be executed with pygame (the folder where you saved the file using Thonny)
- Ensure the file has executable permissions using "chmod +x <filename.py>"
- Execute the file using the command "python3 <filename.py>"
Please feel free to contact your course TA/instructor or email firstname.lastname@example.org for further assistance.