使用 turtle报错 name 'setup' is not defined
报错 not is 39 name defined setup
2023-09-14 09:00:00 时间
使用 turtle报错
Traceback (most recent call last):
File "turtle.py", line 1, in <module>
from turtle import *
File "E:\python\demo\turtle.py", line 2, in <module>
setup(600, 400, 0, 0)
NameError: name 'setup' is not defined
问题原因:
文件名命名为turtle.py
python的import会优先选择当前目录下的文件,找不到才去类目录去找,所以不要把文件的名字设为库名
修改方法:
将脚本文件重命名为其他的名字
相关文章
- Feign报错'xx.FeignClientSpecification', defined in null, could not be registered.
- Qt-Qt在开发过程中提示“报错C1189 No Target Architecture”
- Docker报错 WARNING: IPv4 forwarding is disabled. Networking will not work
- CentOS 6.5 编译 PHP-7 报错:undefined reference to `libiconv_open 无法编译 PHP libiconv
- hibernate中报错could not initialize proxy - no Session的解决方法
- JSON.parse 解析json字符串时,遇换行符报错
- Mac tshark 报错:command not found: tshark
- CentOS下httpd下php 连接mysql 本机可以,外网报错Could not connect: Can't connect to MySQL server on '127.0.0.1' (13)2003 原因解析
- 大叔经验分享(13)spark运行报错WARN Utils: Service 'sparkDriver' could not bind on port 0. Attempting port 1.
- 【2】报错X_LINK_COMMUNICATION_NOT_OPEN或X_LINK_ERROR
- 解决docker报错: ---> [Warning] IPv4 forwarding is disabled. Networking will not work.
- 解决windows10系统ssh-add报错的问题
- hibernate3报错 XXX is not mapped
- 成功解决YOLOv3测试——could not create cudnn handle: CUDNN_STATUS_NOT_INITIALIZE作记录
- 【异常】Clickhouse链接报错Authentication failed: password is incorrect or there is no user with such name
- Tesseract - Java 调用其识别ocr 报错Not a JPEG file: starts with 0x89 0x50 解决
- 【错误记录】Android Studio 编译报错 ( AAPT: error: failed to read PNG signature: file does not start with PN )
- Error parsing XML: not well-formed (invalid token) 报错+R文件消失解决的方法
- Qt开发,报错:进程“D:QtQt5.14.25.14.2msvc2017_64binqmake.exe“退出,退出代码 2 。Error while building/deployin
- SpringCloud报错: "Field discoveryClient in com.controller.DcController required a bean of type 'com.netflix.discovery.DiscoveryClient' that could not be found."
- pip install matplot lib安装报错ERROR: Could not install packages due to an EnvironmentError: [WinError 5
- django 报错:‘staticfiles‘ is not a registered tag library. Must be one of: