[英]Turtle python library not importing
I am pretty new with python and programming.我对python和编程很陌生。 I started using the turtle library but when I installed the library with pip, this error showed:我开始使用 turtle 库,但是当我使用 pip 安装库时,显示此错误:
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-sr9ppuq0/turtle/setup.py'"'"'; __file__='"'"'/tmp/pip-install-sr9ppuq0/turtle/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-install-sr9ppuq0/turtle/pip-egg-info
cwd: /tmp/pip-install-sr9ppuq0/turtle/
Complete output (6 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-sr9ppuq0/turtle/setup.py", line 40
except ValueError, ve:
^
SyntaxError: invalid syntax
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
When I imported the python library, I got this error:当我导入 python 库时,我得到了这个错误:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python3.8/turtle.py", line 107, in <module>
import tkinter as TK
ModuleNotFoundError: No module named 'tkinter'
please help.请帮忙。 And I am also on a linux system.而且我也在linux系统上。
您是否尝试过python -m pip install PythonTurtle
,我认为这是最新的安装名称
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.