shea
shea

Reputation: 111

how to install turtle with python3 on linux

when I install turtle,meet some problem like this :

enter image description here

My python version is 3.5.2 and OS is Ubuntu 16.04 LTS

Upvotes: 11

Views: 47164

Answers (6)

Vishesh Upreti
Vishesh Upreti

Reputation: 1

this worked for me. I am using Pop Os 22.04. Type these commands on the terminal. Hope this will for for you as well.

To install the current version of Python3:

sudo apt-get install python3

To install the pip package manager:

sudo apt install python3-pip

Run the below command in the terminal to install the Turtle library

sudo pip3 install PythonTurtle

To verify the installation:

python3 -m pip show PythonTurtle

Upvotes: 0

Ajal88
Ajal88

Reputation: 371

I have had the same error but on Mac os and I tried to update my python via brew. This fixed my problem. Firstly, give brew permission to access your shared files,

sudo chown -R $(whoiam) /usr/local/share

This was for another problem with brew :D, you can test the next command and use this only if you need to. Finally,

brew upgrade python3

Upvotes: 0

ssssssssssssssssssss
ssssssssssssssssssss

Reputation: 461

apt install python3-tk

It is tested and works perfectly on Linux Mint and Ubuntu...
Edit:
The reason is because turtle is based on tkinter, for example: enter image description here

Upvotes: 8

Leslin
Leslin

Reputation: 51

pip install python-tk

then go to python shell and type

from turtle import*
fd(100)

Upvotes: 2

Stephen Odipo
Stephen Odipo

Reputation: 21

I was am using Ubuntu 18.10 and recently after configuring Python 3 as my default environment I got the same error. I used this command to reconfigure it and it worked.

sudo apt install python3-tk

Success!!

Upvotes: 2

furas
furas

Reputation: 142804

I assume you ask for Turtle to draw forward, left, etc.

It is already installed with Python. You don't have to install it. Probably You may have to install python3-tk using pip3 install python3-tk or rather apt install python3-tk


See

pip search turtle

part of result

turtle (0.0.2) - Turtle is an HTTP proxy whose purpose is to throttle connections to
                 specific hostnames to avoid breaking terms of usage of those API
                 providers (like del.icio.us, technorati and so on).

You try to install some HTTP proxy

except ValueError, ve: is correct syntax in Python 2 but not in Python 3.

Upvotes: 2

Related Questions