【python基础知识】AttributeError: module 'turtle' has no attribute 'setup'

引入文件时报错,网上查资料一下午也没解决。群里咨询了大佬,总算是解决了,非常感谢大佬。正好提醒了我,有了困难,若一段时间解决不了,应该赶快寻求帮助,不然浪费太长时间啊!!!!

而且,像我这种身边没有任何大佬的情况下,还是要多方面寻求找大佬的途径。。。。。。。。。。。。

-------------------------------------------------------------------------------------------------------------

报错信息:

【python基础知识】AttributeError: module 'turtle' has no attribute 'setup'

【python基础知识】AttributeError: module 'turtle' has no attribute 'setup'

解决方案:

 from  . import xxx 

(把xxx换成你的模块名)

大佬解释:

 python 3默认是绝对引用(absolute import),所以,你这里需要明确指出是相对(from .,从当前目录)引入 

如果你想引入xxx模块中的yyy对象,可以这样:

from .xxx import yyy


-----------------------------------------------------------------------------------------------------

默默记下来,下次在遇到就记住了,希望能帮助你们。