argrento / huami-token

Script to obtain watch or band bluetooth token from Huami servers
MIT License
410 stars 94 forks source link

Syntax Error: def get_access_token(self) -> str: #26

Closed patriksharma closed 3 years ago

patriksharma commented 3 years ago

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
Skiti commented 3 years ago

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"

argrento commented 3 years ago

Yes. -> is a python3 feature.

patriksharma commented 3 years ago

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

Screenshot 2021-02-19 at 8 50 21 AM

argrento commented 3 years ago

You should do this: https://github.com/argrento/huami-token#preparation, pt.4. Use either pip or pip3.

malliaridis commented 3 years ago

Had the same problem. Running with pip3 and python3 solved however the problem.