I think my code is nothing wrong. Because it's very simple, it worked very well on my Windows PC, and shows no error message at all.
from turtle import Turtle, Screen
turtle = Turtle()
screen = Screen()
screen.exitonclick()
However, on Pycharm on my Monterey M1 Macbook, the Python Turtle Graphics window shows nothing but black screen and scroll bars.
I think the application called python.app is something wrong. That's why I updated python with brew and re-installed Pycharm, but nothing has changed.
Does anyone know how to fix this? Thank you.
have you tried to install the latest version of python? cause I'm facing the same problem earlier. I tried to install the latest python version and it just works like a charm now.
将pycharm中的interprete pycharm解释器r改为3.9或3.10。
I don't think it has anything to do with the M1 processor. I have an M1 processor and had the same problem. My solution: Create a new project in Python. Previously configured interpreter Select Python 3.10 (the latest installed version). Click the button with the three dots ... Go to the directory of Python 3.10 (current version). IDLE.app -> Contents -> MacOS and -> Select Python. For me it looks like this:
/Applications/Python 3.10/IDLE.app/Contents/MacOS/Python
Then it works for me.
Updating the interpreter will help fix the issue as it did in my M1 Mac and without needing to make a new project. However, there are a few extra steps needed to make sure it's compatible with your M1 chip.
Quick Steps:
/Applications/Python 3.10/IDLE.app/Contents/MacOS/Python
, then press "OK" ( IMPORTANT: Your Python version number may be different so update the "Python 3.10" to the python folder name found in "Applications" )The turtle screen should be now fixed! I hope this helped!
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.