Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problem installing turtle
#1
Photo 
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
bmohamadyar313 likes this post
Reply
#2
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.
Reply
#3
(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.
Reply
#4
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.
Reply
#5
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]
Reply
#6
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
Reply
#7
(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.
Reply
#8
(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?
Reply
#9
(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
Reply
#10
(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.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  [WORKED AROUND] Problem installing elitech-datareader, 'cannot import build_py_2to3' NeilUK 4 1,670 Jul-09-2023, 10:01 AM
Last Post: NeilUK
  Begginer problem with turtle Damien_X 1 2,070 Aug-25-2020, 11:23 AM
Last Post: GOTO10
  Problem Installing rasterio gw1500se 1 2,193 Mar-24-2020, 06:28 PM
Last Post: gw1500se
  Problem installing library thunderspeed 2 2,310 Mar-22-2020, 11:04 PM
Last Post: thunderspeed
  Please help: problem installing/importing langdetect module in Jupyter Notebook ledgreve 3 7,256 Dec-30-2019, 08:17 AM
Last Post: LeanbridgeTech
  Problem installing instaloader ledgreve 21 19,451 Nov-18-2019, 11:28 AM
Last Post: ledgreve
  Problem with installing PyPDF2 Pavel_47 2 6,005 Nov-10-2019, 02:58 PM
Last Post: Pavel_47
  Nested while loop problem + turtle DreamingInsanity 3 2,941 Jul-06-2019, 02:01 PM
Last Post: DreamingInsanity
  wn = turtle.screen() AttributeError: module 'turtle' has no attribute 'screen' Shadower 1 6,165 Feb-06-2019, 01:25 AM
Last Post: woooee
  Problem installing numpy and matplotlib achondrite 1 3,110 Jan-16-2019, 11:43 PM
Last Post: snippsat

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020