M
M
Morrowind2019-11-25 22:45:49
Python
Morrowind, 2019-11-25 22:45:49

How to fix turtle error in Python?

Everything was fine. But at one fine moment, I returned to the code, launched it, and it began to swear by this error.

AttributeError: partially initialized module 'turtle' has no attribute 'Turtle' (most likely due to a circular import

The code itself is banal.
import turtle
t = turtle.Turtle()

t.forward(50)

On the usual IDLE Python, everything works fine, but if you try to run the file through the IDLE saved in VS, the same error occurs. (It's more convenient for me to write on VS)
Tell me where I overlooked?
Asking Google found a similar problem, but the solution was literally trivial to change the file name from turtle.py to something else. I changed, but the effect is 0.
Please tell me what is my mistake.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Morrowind, 2019-11-26
@hekkaaa

I corrected the mistake myself. In the folders for saving there were files called turtle, even some old sketches are unknown as preserved.
Removing fixed the problem.
Conclusion: do not save files with module names in python, or use long inseparable names to be sure.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question