diff --git a/python/conf_vscode/sitecustomize.py b/python/conf_vscode/sitecustomize.py index 3c3abe69c27b..a8bdda6c7db3 100644 --- a/python/conf_vscode/sitecustomize.py +++ b/python/conf_vscode/sitecustomize.py @@ -19,7 +19,10 @@ import os import sys - if "DEBUGPY_ADAPTER_ENDPOINTS" in os.environ and not any("debugpy" in arg for arg in sys.argv): + if ( + "DEBUGPY_ADAPTER_ENDPOINTS" in os.environ and + not any("debugpy" in arg for arg in sys.orig_argv) + ): def install_debugpy(): import debugpy diff --git a/python/run-with-vscode-breakpoints b/python/run-with-vscode-breakpoints index 11c821fa8323..7b86ae66a96b 100755 --- a/python/run-with-vscode-breakpoints +++ b/python/run-with-vscode-breakpoints @@ -44,6 +44,12 @@ if ! python3 -c "import debugpy" 2>/dev/null; then exit 1 fi +# If lib/pyspark.zip exists, issue a warning +if [ -f "$FWDIR/lib/pyspark.zip" ]; then + echo "Warning: lib/pyspark.zip exists. VSCode debugger won't pick up your breakpoints in workers." + echo "You can remove it to avoid potential issues." +fi + # If --hook-daemon is in the arguments, set the env variable to hook the daemon process # Daemon is not hooked by default to avoid potential fork issues new_args=()