2
Collecting turtle
  Using cached turtle-0.0.2.tar.gz (11 kB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [7 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/private/var/folders/55/ljgj9hbd18q1l92gb9cg59200000gn/T/pip-install-f2hhg8w7/turtle_d06be7ddea1b45ebb40cf9614c27628b/setup.py", line 40
          except ValueError, ve:
                 ^^^^^^^^^^^^^^
      SyntaxError: multiple exception types must be parenthesized
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip. hint: See above for details.

martineau
  • 119,623
  • 25
  • 170
  • 301
iman farhang
  • 41
  • 1
  • 3
  • 3
    Turtle is preinstalled with python. – BokiX Apr 05 '22 at 08:26
  • 1
    That looks like you try to install a Package that was created for Python 2 with Python 3. But if we talk about turtle graphics, why do you try to install an external package? It's part of Pythons standard library. You try to install a 13 year old beta version of an HTTP proxy that is called "turtle". – Matthias Apr 05 '22 at 08:28

2 Answers2

2

Ok, I faced this issue with python 3.10.4 and after searching I found two solutions for this problem because this problem not being only with turtle but for other libraries.

#Note: These solutions for downloading any library if you have a problem mentioned above.

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.

  • Those ways to install a library if it does not exist turtle is an example of how to do it not what I meant – Mohammad Al Jadallah Jun 06 '23 at 09:36
  • OP asked about turtle. OP should not have been shown how to use Pip for the task, because it is not appropriate for the task. There are many better existing questions to explain how to use Pip. – Karl Knechtel Jun 08 '23 at 22:03
-1

It is already installed with python. Just use this code to import the module:

import turtle
# now you can start writing code
BokiX
  • 412
  • 2
  • 14