0

I basically can't seem to be able to make turtle work for me. It always prompts errors that the names are not available.
My current issue which I can't seem to solve is that I get the Error:

Cannot import 'Screen' from partially initialized module 'turtle' (most likely due to a circular import).

I am just using a simple code:

from turtle import Screen, Turtle

screen = Screen()

turtle = Turtle ()

turtle.forward(100)

screen.mainloop()

turtle.done()

I would love some ideas on how to solve this issue.

Artur Peniche
  • 481
  • 6
  • 27
  • Your source file is called `turtle.py` - rename it to something different – ForceBru Nov 16 '20 at 11:21
  • @HandsomeBanana -As ForceBru said, when we use the file name "turtle.py", it imports the file instead of the turtle library. The problem can be solved after the name is changed. – Jill Cheng Nov 17 '20 at 08:51
  • Ah makes sense. Clmany thanks. – HandsomeBanana Nov 17 '20 at 16:08
  • Hello! Would this help? [AttributeError: partially initialized module 'turtle' has no attribute 'Turtle' (most likely due to a circular import)](https://stackoverflow.com/questions/60480328/attributeerror-partially-initialized-module-turtle-has-no-attribute-turtle) – Red Nov 27 '20 at 14:20

1 Answers1

0

Try this:

import turtle
screen = turtle.Screen()
turtle = turtle.Turtle()
turtle.forward(100)
screen.mainloop()
turtle.done()

If you want to look at other things in the library click here

AABULUT
  • 50
  • 4