Modulenotfounderror “No Module Named Encodings” error when installing pillow

OS (Sonoma 14.5):
PsychoPy version (v2024.2.0)

I keep trying to install packages such as pillow. What I did was, in the builder, I pressed components, then packages, then tried installing pillow and received the error “No Module Named encodings.” I then tried using pip, but got the same result. I tried installing different versions of pillow and other packages as well, but I keep getting the same error.