3

I am trying to import the package JWT into Python 2.7 and I am getting a SyntaxError: invalid syntax. What can I do to fix this?

enter image description here

4
  • Possible duplicate of What does -> mean in Python function definitions? Commented May 5, 2017 at 17:37
  • You have a Python 3 version of this package installed. Commented May 5, 2017 at 17:44
  • @vaultah I don't see how that directly answers the problem with an import statement. Commented May 5, 2017 at 17:45
  • @user2357112 Thanks that was the problem, needed to install Pyjwt package to get it work thank you. Commented May 5, 2017 at 17:49

2 Answers 2

12

I was trying install jwt for Python 3 when I needed the package Pyjwt for Python 2.7

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

Comments

8

The logical thing to install jwt on Python 2 is:

pip install jwt

Which lead to the error.

The correct install which worked on my side is:

pip install PyJWT

and it worked.

Comments

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.