PythonExecution (@NotNull HelpersAwareTargetEnvironmentRequest helpersAwareTargetRequest, @NotNull PythonExecution pythonScript) { TargetEnvironment.LocalPortBinding ideServerPortBinding = new TargetEnvironment.LocalPortBinding(myIdeDebugServerLocalPort, null); helpersAwareTargetRequest.getTargetEnvironmentRequest().getLocalPortBindings().add(ideServerPortBinding); helpersAwareTargetRequest.getTargetEnvironmentRequest().onEnvironmentPrepared((environment, indicator) -> { try { myServerSocketForDebugging = createServerSocketForDebugging(environment, ideServerPortBinding); } catch (IOException e) { LOG.error("Unable to create server socket for debugging", e); } return null; }); Function<TargetEnvironment, HostPort> ideServerPortBindingValue = TargetEnvironmentFunctions.getTargetEnvironmentValue(ideServerPortBinding); PythonScriptExecution debuggerScript = prepareDebuggerScriptExecution(myProject, ideServerPortBindingValue, myPyState, pythonScript, myProfile, helpersAwareTargetRequest); var configuredInterpreterParameters = myPyState.getConfiguredInterpreterParameters(); var flavor = myPyState.getSdkFlavor(); if (flavor != null) { debuggerScript.getAdditionalInterpreterParameters().addAll(flavor.getExtraDebugOptions()); } debuggerScript.getAdditionalInterpreterParameters().addAll( createInterpreterParametersToPreventPycGenerationInHelpersDir(configuredInterpreterParameters)); debuggerScript.setCharset(PydevConsoleRunnerImpl.CONSOLE_CHARSET); return debuggerScript; }