To extend the answer to @MattDMo , you can force the Anaconda package to use the python3 interpreter by pressing Cmd / Ctrl + Shift + P , then selecting:
Anaconda: Set Python Interpreter
Then insert the path to your python3 interpreter, which you can find with which python3 :
Be sure to include your virtual path if your code uses packages in virtualenv: /path/to/.virtualenvs/nameofvenv/bin/python3
If you are not using a virtual machine, use your python3 system:
/usr/bin/python3 or /usr/local/bin/python3 for homebrew python3 on mac.
Correctly installing it on python3 should fix the Invalid Syntax error in type annotations.
You can also edit the project file directly to set the interpreter paths:
{ "build_systems": [ { "file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)", "name": "Anaconda Python Builder", "selector": "source.python", "shell_cmd": "\"/path/to/.virtualenvs/venvname/bin/python3\" -u \"$file\"" } ], "settings": { "python_interpreter": "/path/to/.virtualenvs/venvname/bin/python3" } }
source share