简体   繁体   中英

Turtle python library not importing

I am pretty new with python and programming. I started using the turtle library but when I installed the library with pip, this error showed:

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:

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.

您是否尝试过python -m pip install PythonTurtle ,我认为这是最新的安装名称

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM