Syntax Error: def get_access_token(self) -> str:
patriksharma opened this issue · 5 comments
I have cloned the repo and installed python on my MAC OS version 10.15.5
When I try to run the command it keep showing me this error message in terminal
MacBook-Pro:huami-token patrik$ python huami_token.py --method xiaomi --bt_keys
File "huami_token.py", line 46
def get_access_token(self) -> str:
^
SyntaxError: invalid syntax
Did you install and use Python3?
I have Python 3.8.6 and run it with the command "python3 huami_token.py --method xiaomi --bt_keys"
Yes. ->
is a python3 feature.
Okay So I was on python 2.7.16 earlier. I decided to update it to latest version.
then I used this command to update python
brew install python3 && cp /usr/local/bin/python3 /usr/local/bin/python
brew upgrade python@3.9
I have tried with both commands and both are showing different error. see attached screenshot from Terminal window
You should do this: https://github.com/argrento/huami-token#preparation, pt.4. Use either pip
or pip3
.
Had the same problem. Running with pip3
and python3
solved however the problem.