Python Forum
Problem installing turtle - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: Problem installing turtle (/thread-14002.html)

Pages: 1 2


Problem installing turtle - MasterJediKnight7 - Nov-10-2018

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


RE: Problem installing turtle - Gribouillis - Nov-10-2018

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.


RE: Problem installing turtle - MasterJediKnight7 - Nov-10-2018

(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.


RE: Problem installing turtle - Gribouillis - Nov-10-2018

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.


RE: Problem installing turtle - MasterJediKnight7 - Nov-10-2018

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]


RE: Problem installing turtle - Gribouillis - Nov-10-2018

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


RE: Problem installing turtle - MasterJediKnight7 - Nov-10-2018

(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.


RE: Problem installing turtle - Gribouillis - Nov-10-2018

(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?


RE: Problem installing turtle - MasterJediKnight7 - Nov-10-2018

(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


RE: Problem installing turtle - Gribouillis - Nov-10-2018

(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.