Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[split] Name error
#1
I have this code but but when I Debug error as bellow:
import turtle
Code:
wn = turtle.Screen()
wn.bgcolor()
wn.title('face of a clock')

clock = turtle.Turtle()
clock.speed(0)
clock.fd(100)

wn.mainloop()

==> Error:
================= RESTART: C:\Users\LAPTOP TL\Desktop\ss.py =================
Traceback (most recent call last):
File "C:\Users\LAPTOP TL\Desktop\ss.py", line 1, in <module>
import turtle
File "<frozen importlib._bootstrap>", line 980, in _find_and_load
File "<frozen importlib._bootstrap>", line 148, in __enter__
File "<frozen importlib._bootstrap>", line 174, in _get_module_lock
File "<frozen importlib._bootstrap>", line 59, in __init__
File "<frozen importlib._bootstrap>", line 59, in __init__
File "C:\Users\LAPTOP TL\AppData\Local\Programs\Python\Python37-32\lib\bdb.py", line 88, in trace_dispatch
return self.dispatch_line(frame)
File "C:\Users\LAPTOP TL\AppData\Local\Programs\Python\Python37-32\lib\bdb.py", line 112, in dispatch_line
self.user_line(frame)
File "C:\Users\LAPTOP TL\AppData\Local\Programs\Python\Python37-32\lib\idlelib\debugger.py", line 24, in user_line
self.gui.interaction(message, frame)
AttributeError: '_ModuleLock' object has no attribute 'name'
[DEBUG ON]

Pls help me handle its. Thanks ALl
Reply
#2
did you name your program file turtle.py ?
If so, rename it.
Reply
#3
according to traceback the file name is ss.py Maybe there is other file names turtle.py in the same folder?
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply
#4
(Sep-01-2019, 12:32 PM)buran Wrote: according to traceback the file name is ss.py Maybe there is other file names turtle.py in the same folder?
Thank you for help to me so much!

i have changed 'name' already but still error when i Debuge appeared error: KeyError:'turtle' affter step continue to line 59 stop can not step and appear error: "AttributeError: '_ModuleLock' object has no attribute 'name'"
Do you have Idea for this instance ? Thanks you

(Sep-01-2019, 12:27 PM)ThomasL Wrote: did you name your program file turtle.py ? If so, rename it.
Hi ThomasL !
i have set new name agian but anything changed still appear this error.
Do you have other Idea for Me? Thank you
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  [split] Python beginner: Weird Syntax Error mnsaathvika 1 2,096 Jul-22-2019, 06:14 AM
Last Post: buran
  [split] No Error, and No Output vishal2894 1 1,674 Jul-02-2019, 03:20 PM
Last Post: nilamo
  [split] Name error/is not defined rajkiran 1 3,914 Dec-27-2018, 06:47 PM
Last Post: micseydel
  [split] Python error jazzy 1 2,119 Dec-20-2018, 07:35 PM
Last Post: nilamo
  [split] Web Crawler Error takaa 1 3,621 Feb-17-2017, 11:54 AM
Last Post: wavic

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020