Python turtle.Screen() not working properly on new Mac. Google has failed me

Viewed 162

I recently got a new computer (Mac 14" Monterey OS) and reinstalled Python, PyCharm, etc. Everything seems to work okay except when running turtle Screen(). The code finishes with exit code 0 (no errors) but when the launcher pops up its just a tiny black screen that flickers. Doesn't even display the title correctly anymore.

It seems I've tried everything: re-installing Python, installing a later version (Python 3.9 vs 3.10) and reinstalling PyCharm, making sure the interpreter is okay. Nothing is working. I've spent about 2 hours googling to find a solution. I'm stuck and frustrated since I am supposed to be doing a coding workthrough with a company this coming week.

Here is the code that should be running:

import turtle

screen = turtle.Screen()
screen.title("States Game")
image = "blank_states_img.gif"
screen.addshape(image)

turtle.shape(image)
def get_mouse_click_coor(x, y):
    print(x, y)

turtle.onscreenclick(get_mouse_click_coor)

screen.exitonclick()

And here is an image of what is going on... please click this link to see image

1 Answers

Check your python interpreter version. I have the same issue when it uses python3.8, after upgrading to 3.9. It works perfectly. enter image description here

Related