I'm not sure if this also works with pixi.
If you are using the new version of VSCode (and the corresponding Python extension), you have to install the Python Environment (yes, it is a pre-release extension) and enable it by:
"python.useEnvironmentsExtension": true
Refer to this post: Reddit