Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

No module named 'turtle' [duplicate]

i am learning and trying to make a snake game in Python3 i am importing turtle

i am using: Linux mint 19, PyCharm, python37, python3-tk

Traceback (most recent call last):
  File "/home/buszter/PycharmProjects/untitled1/snake.py", line 2, in <module>
    import turtle
ModuleNotFoundError: No module named 'turtle'

everywhere i am reading turtle should be preinstalled, but i still dont have it :(

i tried pip install turtle and says

 pip install turtle
Collecting turtle
  Using cached https://files.pythonhosted.org/packages/ff/f0/21a42e9e424d24bdd0e509d5ed3c7dfb8f47d962d9c044dba903b0b4a26f/turtle-0.0.2.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-kvf9on0y/turtle/setup.py", line 40
        except ValueError, ve:
                         ^
    SyntaxError: invalid syntax

    -------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-kvf9on0y/turtle/

EDIT

screenshot of settings of the project in pycharm

screenshot of settings of the project in pycharm

like image 437
buszter Avatar asked Feb 28 '26 07:02

buszter


1 Answers

I know that it's kinda old topic, but I had the same problem right now on my Fedora 31. Reinstalling packages didn't work.
What worked was installing IDLE programming tool (that's just Python IDE for kids), which installs also tkinter module.
I think that installing just python3-tkinter (that's how this package is named in Fedora repo) package would work as well, because turtle is inside Tk module.

like image 112
Garbulix Avatar answered Mar 01 '26 19:03

Garbulix



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!