0

Getting this error when running pip install -U selenium. Mid way through the script, it gets the following SyntaxError:

    Traceback (most recent call last):
      File "<string>", line 14, in <module>
      File "C:\Python32\Scripts\build\rdflib\setup.py", line 6, in <module>
        from rdflib import __version__
      File "rdflib\__init__.py", line 64, in <module>
        from rdflib.term import URIRef, BNode, Literal, Variable
      File "rdflib\term.py", line 367
        except TypeError, te:
                        ^
    SyntaxError: invalid syntax
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):

  File "<string>", line 14, in <module>

  File "C:\Python32\Scripts\build\rdflib\setup.py", line 6, in <module>

    from rdflib import __version__

  File "rdflib\__init__.py", line 64, in <module>

    from rdflib.term import URIRef, BNode, Literal, Variable

  File "rdflib\term.py", line 367

    except TypeError, te:

                    ^

SyntaxError: invalid syntax

----------------------------------------
Command python setup.py egg_info failed with error code 1

Since it is a Syntax Error, I assume it is a python version problem, I'm running 3.2.2. Pip did come with a pip-3.2.exe file, which I tried to run. But I got the same error. I'm pretty new to Python so it might be something simple.

And how can it be a syntaxError? pip is an already made program.

Running Win7, Python 3.2.2

1 Answer 1

4

Selenium does not support Python 3. Use Python 2.7 instead.

Sadly, almost all Python software requires Python 2.x.

[Update]
Selenium supports Python 3.x now.

Sign up to request clarification or add additional context in comments.

3 Comments

Once you install Python2, run pip2 instead of pip.
I've noticed that everywhere I look people are always talking about 2.x, never about 3.x. Well I used the easy_install.exe instead of pip and it worked (I think?). I thought Python was supposed to be easy. I guess the easiness of the languages must be balanced by the hardness of installation. -_-
Does it hold true even now. That Selenium does not work with Py3.x?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.