I spent so long solving this problem I wanted to post it in case it helps others.
I have a django project in Visual Studio Code and I configured a virtual environment for the project. I would run the project in the Integrated Terminal using manage.py runserver
after activating my virtual environment and that worked. I created a debug configuration with the default launch.json for django projects. Running the debugger, I got this error:
(fields.E210) Cannot use ImageField because Pillow is not installed.HINT: Get Pillow at https://pypi.org/project/Pillow/ or run command "python -m pip install Pillow".
Pillow was installed in the virtual environment as well as my global python installation.