I ran into the same error - it’s incredibly demoralising when learning something new, and out of the box the very first thing you do doesn’t work.
I found my answer here
ssh into your box, and run pip install pillow==8.2
. Then try and run the code again.