[英]Turtle python library not importing
我對python和編程很陌生。 我開始使用 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.
當我導入 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'
請幫忙。 而且我也在linux系統上。
您是否嘗試過python -m pip install PythonTurtle
,我認為這是最新的安裝名稱
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.