For anyone looking for recent info on this, I recently came across this error where I had a conda env selected as the interpreter but the debugger was being launched with the base environment. This caused issues as the two environments had different versions of pyspark and caused the following error:
Python in worker has different version 3.8 than that in driver 3.9
Then I came across this issue, and while it doesn't provide a fix, it gives a workaround as follows:
- Close VScode (if running)
- Open a terminal
- (optional) navigate to the folder you want e.g.
cd /projects/cool_name
- Activate conda environment
conda activate my_env
- Launch VScode from the current terminal
code .
This will launch new VScode window in your current directory and using the debugger should pick up my_env
.