Reputation: 11
I'm learning Python on a Mac and I am initiating the program through Terminal. I'm trying to save all of the code through my text editor Sublime but unfortunately I'm having issues importing Turtle.
I start by putting:
import Turtle
turtle.showturtle()
in Sublime but I get an error:
Gabriels-Air:Desktop gabrielmendez$ python intro.py
Traceback (most recent call last):
File "intro.py", line 38, in <module>
import Turtle
ImportError: No module named Turtle
My file is named intro.py and I did change the directory to my desktop since that's where my file is at. I've used Turtle straight on the terminal but I want to be able to keep the code. I've looked online and I can't find my answer. Any help please?
Upvotes: 1
Views: 2419
Reputation: 101
Python is case-sensitive.
Python reads
import Turtle
as you trying to import functions from Turtle.py. However, the module in python is lowercase, so use this line:
import turtle
Upvotes: 2