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


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

(Nov-10-2018, 10:41 PM)Gribouillis Wrote:
(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.
This code works:
from turtle import*
forward(120)
left(90)
color('red')
forward(80)
But this two I still have the problem of forward that isn't defined.
from turtle import*

while True:
    foward(1)
    left(1.15)

color("blue")
pensize(4)

for i in range(313):
    foward(2)
    left(1.15)
from turtle import*
myTurtle = turtle.Turtle()
myTurtle.circle(50)
turtle.getscreen()._root.mainloop()
Would it be because the syntax is wrong or the use of the different function incorrect?


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

The problem is not with the code, the problem is with the file bearing the same name as the standard module turtle. After each line from turtle import *, add the line import turtle; print(turtle). It should print the path of the files that cause the problem.


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

<module 'turtle' from 'C:\\Users\\jedi\\AppData\\Local\\Programs\\Python\\Python37\\lib\\turtle.py'>


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

Do it in the program that doesn't work.

Also if you still have a file named turtle.py in the folder A:\0_ingschool\Courses\Fundamentals of Algorithm\Python\Group Projects\, then change its name. Choose seaturtle.py instead.


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

For the while True program it gives me this adding the import turtle, print("turtle"):

<module 'turtle' from 'C:\\Users\\jedi\\AppData\\Local\\Programs\\Python\\Python37\\lib\\turtle.py'>
Traceback (most recent call last):
File "A:\0_ingschool\Courses\Fundamentals of Algorithm\Python\Group Projects\", line 5, in <module>
foward(1)
NameError: name 'foward' is not defined
>>>

I have changed all the names of the programs that were had "turtle" in the file .


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

I've found the error, look carefully NameError: name 'foward' is not defined

You wrote foward instead of forward!


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

Confused Oups.
Sorry about that.
Thanks for your help.
I must have been tired.
Sorry to have taken your time for just that simple error.


RE: Problem installing turtle - bmohamadyar313 - Mar-18-2024

(Nov-10-2018, 07:55 PM)MasterJediKnight7 Wrote: 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

Heart Heart Heart
Heart Heart Heart
Heart Heart Heart
Hi
this is answer of your problem:
https://stackoverflow.com/questions/71748383/unable-to-install-turtle-module

So you could try this way:

pip install turtle==0.0.1

0.0.1 This is the last version of the library so you should find the version of the library that you want to install for this purpose, you can find the version of the library using this command:

pip show module <name_of_the_library>

another solution that could work is using --use-deprecated=backtrack-on-build-failures

Example:

pip install turtle --use-deprecated=backtrack-on-build-failures

Hope to help you.