I'm trying to troubleshoot an issue with VSCode's Python extension loading the wrong version of Python and I'd like to rule out incorrect environment variables being an issue.
In the Python Extension's settings there is the following option:
My workspace doesn't contain a ./env
file. What will VSCode's Python extension default to in this situation?
Take a look at the official VSCode documentation on Environment Variable Definition Files. I think the following section is relevant to your question:
As you can see, the .env
file is there to set the value of any pre-existing environment variables.
If the file existed but had no key-value pairs in it then the environment variables would be unchanged from the system's own definitions.
Therefore, if .env
doesn't exist, the environment variables will be defined by your system. This is the default behaviour.