"SyntaxError: invalid syntax. Perhaps you forgot a comma?"

I am trying to install Pillow to add images to a Tkinter GUI. Here I am attempting to install and upgrade pip to then install PIL. However, on my Windows computer all I’m getting is this error message. What is going on? Can anyone help to figure out how to upload images to a GUI, if there’s an alternative?

>>> python -m pip install -U pip
  File "<stdin>", line 1
    python -m pip install -U pip
SyntaxError: invalid syntax. Perhaps you forgot a comma?

Source: Windows Questions

One Reply to “"SyntaxError: invalid syntax. Perhaps you forgot a comma?"”

  • So I had a student get the same error message while trying to install lxml. When I googled the error message I saw that you were the only person on the Internet that had the same question. We spent some time trying to figure out what it was and finally I had her uninstall python 3.10 and install an older version. Problem solved!!! It appears to be a bug in python 3.10.