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?
            Asked
            
        
        
            Active
            
        
            Viewed 4,926 times
        
    3
            
            
        - 
                    Possible duplicate of [What does -> mean in Python function definitions?](http://stackoverflow.com/questions/14379753/what-does-mean-in-python-function-definitions) – vaultah May 05 '17 at 17:37
- 
                    You have a Python 3 version of this package installed. – user2357112 May 05 '17 at 17:44
- 
                    @vaultah I don't see how that directly answers the problem with an import statement. – Big_Ozzy May 05 '17 at 17:45
- 
                    @user2357112 Thanks that was the problem, needed to install Pyjwt package to get it work thank you. – Big_Ozzy May 05 '17 at 17:49
2 Answers
12
            I was trying install jwt for Python 3 when I needed the package Pyjwt for Python 2.7
 
    
    
        Big_Ozzy
        
- 275
- 4
- 13
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.
 
    
    
        Julian Wise
        
- 380
- 1
- 3
- 16

