commands not working?

SyntaxError: invalid syntax

py -m pip install discord
File “”, line 1
py -m pip install discord
^^^

That should be entered at an OS prompt (Command Prompt window if you’re on Windows), not at the Python prompt.