D
D
DUDE2021-01-20 19:04:05
Python
DUDE, 2021-01-20 19:04:05

Why invalid python-jose syntax?

No matter how I tried to install python-jose, I get an error:

File "/usr/local/lib/python3.8/dist-packages/jose.py", line 546
    print decrypt(deserialize_compact(jwt), {'k':key},
          ^
SyntaxError: invalid syntax

All because of an unopened print bracket in the library

def cli_decrypt(jwt, key):
    print decrypt(deserialize_compact(jwt), {'k':key},
        validate_claims=False)

PyCharm also swears that the dependency is not in requirements.txt, although it is there

Package containing module 'jose' is not listed in project requirements


Who faced this?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
W
Wispik, 2021-01-20
@Wispik

judging by the syntax jose for the second python was installed. How did you set him up?
this is how you need it:
pip install python-jose

R
Roman Kitaev, 2021-01-20
@deliro

print is a function. Call with parentheses

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question