Search code examples
pythonpippypipython-turtle

Turtle Python Package Could Not Be Installed On Ubuntu


As you can see below, The turtle package could not be install on the machine and raised errors and even note that i've install python-tk package on ubuntu, how could i solve the problem? Turtle Python Package


Solution

  • You don't need to install turtle at all

    The turtle graphics library built on top of python-tk is part of the Python 3 standard library. It doesn't require installation: It's already included with Python 3.

    The thing pip is trying to install is a much older library with the same name but built for a completely different purpose, which was never updated to be compatible with Python 3 in the first place.

    Just import turtle. You don't need to install anything first.

    (That said, note that you need python3-tk, not python-tk, to use turtle with Python 3).


    To demonstrate the above, see https://packages.ubuntu.com/jammy/amd64/libpython3.10-stdlib/filelist, listing the files included in libpython3.10-stdlib for the Jammy release of Ubuntu; you'll see /usr/lib/python3.10/turtle.py included.