For me I was able to resolve this by selecting the interpreter in VSCode that matched the path. This was actually not the recommended interpreter so it was not the most intuitive.
I ran ctrl, shift, p to open the palette and then up above chose the interpreter that had been created for my project specifically and not the global.
This has been a problem for two projects so far so I assume it is fairly common. This fixed my error both times.