Python Forum

Full Version: Problem installing turtle
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hi. I have a problem when I try to install the module Turtle.

I can't find anything about that error anywhere.
When I do "pip install turtle", it doesn't work either.
Can someone give me some advice, please?

Here is an example:

[Image: open?id=1OYhZmDtLUdzj4W7uHuTB92noQaDGLBsE]

Python version 3.7.1
pip version:18.1
Are you sure you want to install this turtle module? It is different from the turtle module from the standard library (which you don't need to install).

The line except ValueError, ve: raises a SyntaxError because it is a python 2 syntax. This turtle module may not be available for python 3.7. The latest version dates from 2009.
(Nov-10-2018, 08:01 PM)Gribouillis Wrote: [ -> ]Are you sure you want to install this turtle module? It is different from the turtle module from the standard library (which you don't need to install).

The line except ValueError, ve: raises a SyntaxError because it is a python 2 syntax. This turtle module may not be available for python 3.7. The latest version dates from 2009.
I'm trying to install this turtle. I think the standard library is damage because it doesn't recognize "forward()".
The turtle worked with the 3.6.6 version of Python.

That's why I'm trying to reinstall it.
Don't try to reinstall standard library modules. They're not broken. The most likely problem is that you have another file named turtle.py in your current directory or somewhere on the python path. Try this
import turtle
print(turtle)
and see if the file is the standard library's module turtle. If you have another file named turtle.py on the python path, rename it to something else.
This is what it gives me:
<module 'turtle' from 'C:\\Users\\jedi\\AppData\\Local\\Programs\\Python\\Python37\\lib\\turtle.py'>
And here what I find the files with turtle in their name.
[Image: open?id=1fqIpFblvzOQnVqatnlv1DM3X_iz70OEo]
Can you list all the files named turtle.py or turtle.pyc on the computer ? Keep only the one that's in python's standard library. You could try for example
import types
print(types)
to find the directory
(Nov-10-2018, 09:00 PM)Gribouillis Wrote: [ -> ]Can you list all the files named turtle.py or turtle.pyc on the computer ? Keep only the one that's in python's standard library. You could try for example
import types
print(types)
to find the directory
I know that in the file Python, I have a file launcher and a file Python36-32.
Would it be because of the files of that last folder?

I have deleted the Python 36-32 file.
But nothing changes.
(Nov-10-2018, 08:07 PM)MasterJediKnight7 Wrote: [ -> ]I think the standard library is damage because it doesn't recognize "forward()".
Can you post example code where this fails, with the complete output and error message?
(Nov-10-2018, 09:57 PM)Gribouillis Wrote: [ -> ]
(Nov-10-2018, 08:07 PM)MasterJediKnight7 Wrote: [ -> ]I think the standard library is damage because it doesn't recognize "forward()".
Can you post example code where this fails, with the complete output and error message?
from turtle import*
myTurtle = turtle.Turtle()
myTurtle.circle(50)
turtle.getscreen()._root.mainloop()
Traceback (most recent call last):
File "A:\0_ingschool\Courses\Fundamentals of Algorithm\Python\Group Projects\turtle1.py", line 1, in <module>
from turtle import*
File "A:\0_ingschool\Courses\Fundamentals of Algorithm\Python\Group Projects\turtle.py", line 2, in <module>
forward(120)
NameError: name 'forward' is not defined
(Nov-10-2018, 10:15 PM)MasterJediKnight7 Wrote: [ -> ]A:\0_ingschool\Courses\Fundamentals of Algorithm\Python\Group Projects\turtle.py
This is most certainly the faulty file. Try to give another name to this file.
Pages: 1 2