AttributeError: partially initialized module ‘turtle’ has no attribute ‘setup’ resolution process

tags: python  Programming language

In learning python, I always report this error when practicing drawing pictures:

Traceback (most recent call last): File “E:\Learning\python\turtle.py”,
line 1, in import turtle File "E:\learning\python\turtle.py",
line 2, in turtle.setup(650, 350, 200, 200) AttributeError: partially initialized module ‘turtle’ has no attribute ‘setup’ (most likely dueo a circular import)

The ghost knows how many times I have changed it, and then I found a strange phenomenon. If I import turtle in the console (close the file just now and restart the idle, it doesn't work), there is no problem, as shown in the figure:

Then I suddenly realized whether there was a problem with my file naming...

If turtle is imported here, it is actually the file I wrote myself... It’s amazing, just change the name, hehe, look at my pink python:

Life is short, I hope I can learn python well so that I can move bricks in the future...

Intelligent Recommendation

AttributeError: partially initialized module ‘json‘ has no attribute ‘dumps‘

Introduction:pythonthe road-AttributeError: partially initialized module 'json' has no attribute 'dumps' author:Excellent small white Github:Follow YX-xiaobai Hobby:Americano More Ice ! Todaypythonofj...

[Solve Error]: AttributeError: Partially Initialized Module 'Re' Has No Attribute 'IgnoreCase'

I have troubled my long-lasting question, and I can solve it so easy! ! ! ! code show as below: Error: Attributeerror: Partially Initialized Module 'Re' Has No Attribute 'Ignorecase' Seeing a same pro...

AttributeError: partially initialized module ‘cv2‘ has no attribute ‘_registerMatType‘

Install the new version of MMDETECTION (mmdet = 2.25.0, mmcv = 1.5.3) to report an error. Because OpenCV-Python's bag from 4.3.0 and 3.4.10 Build is not good for the old version system, the solution: ...

AttributeError: partially initialized module ‘cv2‘ has no attribute ‘gapi_wip_gst_GStreamerPipeline‘

Installdeepforestback,opencv-pythonImportimport cv2Show the following error D:\code_management\pythonProjectIt's my project path Uninstall OPENCV first, and then install the latest version. Regarding ...

AttributeError: partially initialized module ‘jmespath’ has no attribute ‘search’

AttributeError: partially initialized module ‘jmespath’ has no attribute ‘search’ Reason: The .py file command and the jmespath library have the same name Solution: just rename...

More Recommendation

[Python] the basics AttributeError: module 'turtle' has no attribute 'setup'

When introducing an error file, online information did not solve all afternoon. The group consulted with chiefs, finally resolved, thank you very much big brother. Just reminded me, with difficulty, i...

AttributeError: module turtle has no attribute setup+file rename

The Python file name should not be the same as the library name and function name! ! ! Reason for error: The name of the python file is named turtle or a module name is wrong (I am) Solution: Rename p...

[The bug has been resolved] attributeerror: Partially Initialized Module 'Visdom' Has No Attribute 'Visdom'

Project scene Create a Visdom environment Problem Description python visdom.py Cause Analysis The code is prioritized in the file with the file in the folder, so there is no import visdom when IMPORT ...

AttributeError: partially initialized module 'struct' has no attribute 'pack' (most likely due to a

Error: AttributeError: partially initialized module'struct' has no attribute'pack' (most likely due to a circular import) struct.py Reason: The file name is the same as the import package name, just c...

AttributeError: partially initialized module ‘pandas‘ has no attribute ‘Series‘ (most likely due to

Record your own stupid moments AttributeError: partially initialized module ‘pandas’ has no attribute ‘Series’ (most likely due to a circular import) 1. I am already determined...

Copyright  DMCA © 2018-2026 - All Rights Reserved - www.programmersought.com  User Notice

Top