pyjwt 2.0.0 is not compatible with Python 3.5
See original GitHub issueSummary
pyjwt 2.0.0 is using a syntax only valid in Python 3.6 onwards that breaks Python 3.5 support.
Possible resolutions would be indicating version 2.0.0
available for Python 3.6 onwards in https://github.com/jpadilla/pyjwt/blob/master/CHANGELOG.md.
Ref: https://github.com/PyGithub/PyGithub/issues/1796
Expected Result
No error.
Actual Result
...
File "/ephemeral/jenkins/shared_job_workspace/cb93627ca717/pipeline/xxx/xxx/.venv/lib/python3.5/site-packages/github/__init__.py", line 58, in <module>
from github.MainClass import Github, GithubIntegration
File "/ephemeral/jenkins/shared_job_workspace/cb93627ca717/pipeline/xxx/xxx/.venv/lib/python3.5/site-packages/github/MainClass.py", line 57, in <module>
import jwt
File "/ephemeral/jenkins/shared_job_workspace/cb93627ca717/pipeline/xxx/xxx/.venv/lib/python3.5/site-packages/jwt/__init__.py", line 1, in <module>
from .api_jws import (
File "/ephemeral/jenkins/shared_job_workspace/cb93627ca717/pipeline/xxx/xxx/.venv/lib/python3.5/site-packages/jwt/api_jws.py", line 134
**kwargs,
^
SyntaxError: invalid syntax
Reproduction Steps
Run the following code in Python 3.5 will fail:
def decode(
self,
jwt: str,
key: str,
algorithms,
options,
**kwargs,
) -> str:
pass
File "<stdin>", line 7
**kwargs,
^
SyntaxError: invalid syntax
>>> ) -> str:
File "<stdin>", line 1
) -> str:
^
SyntaxError: invalid syntax
In comparison, the following code will run in Python 3.5:
def decode(
self,
jwt: str,
key: str,
algorithms,
options,
**kwargs
) -> str:
pass
System Information
$ python -m jwt.help
{
"cryptography": {
"version": ""
},
"implementation": {
"name": "CPython",
"version": "3.5.10"
},
"platform": {
"release": "5.4.0-1030-aws",
"system": "Linux"
},
"pyjwt": {
"version": "2.0.0"
}
}
This command is only available on PyJWT v1.6.3 and greater. Otherwise, please provide some basic information about your system.
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Changelog — PyJWT 2.0.1 documentation
Version 1.7.1 is the last one supporting Python 3.0-3.5. ... Improve typings¶. We no longer need to use mypy Python 2 compatibility mode...
Read more >No matching distribution found for PyJWT<3.0.0,>=2.0.1
So the problem was that when I executed pip --version, it showed python 2.7 version which is deprecated in PyJWT. I solved it...
Read more >pyjwt Changelog - pyup.io
Skip keys with incompatible alg when loading JWKSet by DaGuich in `762 ... Use timezone package as Python 3.5+ is required. ... 2.0.0....
Read more >Developers - pyjwt 2.0.0 is not compatible with Python 3.5 -
pyjwt 2.0.0 is not compatible with Python 3.5. ... pyjwt 2.0.0 is using a syntax only valid in Python 3.6 onwards that breaks...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
python 3.5 is EOL already so not supportd in v2.0 😃
yeah you need at least pip 9.x – I’d suggest using a virtuaenv either way and not the system pip/python