SyntaxError in setup.py with pip to install module

Question:

So my teacher in Python showed the turtle module, so I want to try it myself, but when I try to install the turtle module on my PC I have an error:
I’m using "pip" to install modules, so when I do "pip install turtle" on a console
(not Python console) I have an error :

Collecting turtle
using cached turtle-0.0.2.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:UsersDaxxasAppDataLocalTemppip-build-727hpv0wturtlesetup.py", line40
except ValueError, ve:
                 ^
SyntaxError: invalid syntax

and there is this in red :

Command "python setup.py egg_info" failed with error code 1 C:UsersDaxxasAppDataLocaltemppip-build-727hpv0wturtle

And I don’t know what to do. There isn’t pip’s folder in "Temp".

So how can I fix this to be able to install the turtle module ?

ps : Is it possible to copy/paste something in a console ?

Asked By: daxxas159

||

Answers:

Turtle is already included in the Python standard library; you don’t need to install anything.

The library you were installing is a completely different thing (an HTTP proxy, apparently) which looks like it’s not compatible with any recent Python version.

Answered By: Daniel Roseman

This might be happening because you are trying to install a library that is already included in the standard library.

For example, I was trying to install hashlib using pip and was getting a similar error

python -m pip install hashlib
Complete output from command python setup.py egg_info:
....
File "C:UsersblaAppDataLocalTemppip-build-l8pg66ydhashlibhashlib.py", line 80
        raise ValueError, "unsupported hash type"
                        ^
    SyntaxError: invalid syntax

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:UsersblaAppDataLocalTemppip-build-l8pg66ydhashlib

If you are not able to resolve the library, you might have not correctly setup the python interpreter or SDK in your IDE. Check if that is the case.

Answered By: Abbas Gadhia

If you name your file turtle.py, it will give you this error. I figured it out after I had finished checked my Python interpreter, settings, etc.

Answered By: Anderson Fiolina

Is it possible to copy/paste something in a console ?

YES SHIFT+INSERT

This shortcut works well with console as well as with console tools ie vim, emacs, nano etc.

Answered By: Artur Mickiewicz
Categories: questions Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.