Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attempting to launch python with the "console" option set to "internalConsole" in launch.json causes an error dialog #607

Closed
Thundercraft5 opened this issue May 4, 2021 · 5 comments

Comments

@Thundercraft5
Copy link

Environment data

  • VS Code version: 1.55
  • Extension version (available under the Extensions sidebar): v2021.4.765268190
  • OS and version: Windows 10 pro, 19041
  • Python version (& distribution if applicable, e.g. Anaconda): 3.8.5 (With Anaconda)
  • Type of virtual environment used: conda
  • Relevant/affected Python packages and their versions: -
  • Relevant/affected Python-related VS Code extensions and their versions: Pylance: v2021.4.3, Python indent: v1.14.2, Python Test Explorer for Visual Studio Code: v0.6.8, Python Path: v0.0.11, python snippets: v1.0.2, Python Type Hint: v1.4.1, MagicPython: v1.1.0
  • Value of the python.languageServer setting: Pylance

Expected behaviour

The extension should launch the python code in the VSCode internal debug console.

Actual behaviour

Attempting to launch the python code causes the error dialog with the message "Invalid message: Duplicate entries in "env"" to appear instead of running the python code.
Setting the "console" option set to "integratedTerminal" in launch.json does not cause this error.
Disabling all my extensions except Python does not change anything.

Steps to reproduce:

  1. Add this python launch.json config:
{
	"name": "Python: Launch",
	"type": "python",
	"request": "launch",
	"console": "internalConsole",
	"program": "${file}",
},
  1. Open any python file
  2. Select the config provided and launch the file via the built-in debugger
  3. The error should show up

Logs

Output for Python in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python)

User belongs to experiment group 'pythonaacf'
User belongs to experiment group 'pythonJediLSPcf'
User belongs to experiment group 'pythonDiscoveryModulecf'
User belongs to experiment group 'pythonTensorboardExperiment'
User belongs to experiment group 'PythonPyTorchProfiler'
User belongs to experiment group 'ShowPlayIcon - start'
User belongs to experiment group 'ShowExtensionSurveyPrompt - control'
User belongs to experiment group 'DebugAdapterFactory - experiment'
User belongs to experiment group 'PtvsdWheels37 - experiment'
User belongs to experiment group 'UseTerminalToGetActivatedEnvVars - control'
User belongs to experiment group 'AA_testing - experiment'
User belongs to experiment group 'LocalZMQKernel - experiment'
User belongs to experiment group 'CollectLSRequestTiming - control'
User belongs to experiment group 'CollectNodeLSRequestTiming - experiment'
User belongs to experiment group 'EnableIPyWidgets - experiment'
User belongs to experiment group 'DeprecatePythonPath - experiment'
User belongs to experiment group 'RunByLine - experiment'
User belongs to experiment group 'CustomEditorSupport - control'
> pyenv root
> conda --version
> python3.7 c:\Users\NKGOO\.vscode\extensions\ms-python.python-2021.4.765268190\pythonFiles\pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> python3.6 c:\Users\NKGOO\.vscode\extensions\ms-python.python-2021.4.765268190\pythonFiles\pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> python2 c:\Users\NKGOO\.vscode\extensions\ms-python.python-2021.4.765268190\pythonFiles\pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> py -3.7 c:\Users\NKGOO\.vscode\extensions\ms-python.python-2021.4.765268190\pythonFiles\pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> python c:\Users\NKGOO\.vscode\extensions\ms-python.python-2021.4.765268190\pythonFiles\pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> py -3 c:\Users\NKGOO\.vscode\extensions\ms-python.python-2021.4.765268190\pythonFiles\pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> py -3.6 c:\Users\NKGOO\.vscode\extensions\ms-python.python-2021.4.765268190\pythonFiles\pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> py -2 c:\Users\NKGOO\.vscode\extensions\ms-python.python-2021.4.765268190\pythonFiles\pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> python c:\Users\NKGOO\.vscode\extensions\ms-python.python-2021.4.765268190\pythonFiles\pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> python3 c:\Users\NKGOO\.vscode\extensions\ms-python.python-2021.4.765268190\pythonFiles\pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> conda info --json
Error 2021-05-04 12:27:03: Detection of Python Interpreter for Command python3.7 and args  failed as file  does not exist
Error 2021-05-04 12:27:03: Detection of Python Interpreter for Command python3 and args  failed as file  does not exist
Error 2021-05-04 12:27:04: Detection of Python Interpreter for Command py and args -2 failed as file Python 2 not found!

 -3.9-64
 -3.8-64 does not exist
Error 2021-05-04 12:27:04: Detection of Python Interpreter for Command py and args -3.6 failed as file Python 3.6 not found!

 -3.9-64
 -3.8-64 does not exist
Error 2021-05-04 12:27:04: Detection of Python Interpreter for Command py and args -3.7 failed as file Python 3.7 not found!

 -3.9-64
 -3.8-64 does not exist
Starting Pylance language server.
Python interpreter path: .\.venv\Scripts\python.exe
Error 2021-05-04 12:27:04: Failed to get interpreter information for 'C:\Users\NKGOO\AppData\Local\Microsoft\WindowsApps\python3.exe' Error: Command failed: "C:\\Users\NKGOO\AppData\Local\Microsoft\WindowsApps\python3.exe" "c:\Users\NKGOO\.vscode\extensions\ms-python.python-2021.4.765268190\pythonFiles\pyvsc-run-isolated.py" "c:\Users\NKGOO\.vscode\extensions\ms-python.python-2021.4.765268190\pythonFiles\interpreterInfo.py"
Python was not found but can be installed from the Microsoft Store: ms-windows-store://pdp/?productid=9NJ46SX7X90P
    at ChildProcess.exithandler (child_process.js:312:12)
    at ChildProcess.emit (events.js:315:20)
    at maybeClose (internal/child_process.js:1021:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5) {
  killed: false,
  code: 9009,
  signal: null,
  cmd: '"C:\\\\Users\\NKGOO\\AppData\\Local\\Microsoft\\WindowsApps\\python3.exe" "c:\\Users\\NKGOO\\.vscode\\extensions\\ms-python.python-2021.4.765268190\\pythonFiles\\pyvsc-run-isolated.py" "c:\\Users\\NKGOO\\.vscode\\extensions\\ms-python.python-2021.4.765268190\\pythonFiles\\interpreterInfo.py"'
}
Error 2021-05-04 12:27:04: Failed to get interpreter information for 'C:\Users\NKGOO\AppData\Local\Microsoft\WindowsApps\python.exe' Error: Command failed: "C:\\Users\NKGOO\AppData\Local\Microsoft\WindowsApps\python.exe" "c:\Users\NKGOO\.vscode\extensions\ms-python.python-2021.4.765268190\pythonFiles\pyvsc-run-isolated.py" "c:\Users\NKGOO\.vscode\extensions\ms-python.python-2021.4.765268190\pythonFiles\interpreterInfo.py"
Python was not found but can be installed from the Microsoft Store: ms-windows-store://pdp/?productid=9NJ46SX7X90P
    at ChildProcess.exithandler (child_process.js:312:12)
    at ChildProcess.emit (events.js:315:20)
    at maybeClose (internal/child_process.js:1021:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5) {
  killed: false,
  code: 9009,
  signal: null,
  cmd: '"C:\\\\Users\\NKGOO\\AppData\\Local\\Microsoft\\WindowsApps\\python.exe" "c:\\Users\\NKGOO\\.vscode\\extensions\\ms-python.python-2021.4.765268190\\pythonFiles\\pyvsc-run-isolated.py" "c:\\Users\\NKGOO\\.vscode\\extensions\\ms-python.python-2021.4.765268190\\pythonFiles\\interpreterInfo.py"'
}
Error 2021-05-04 12:27:04: Failed to get interpreter information for 'C:\Users\NKGOO\AppData\Local\Microsoft\WindowsApps\python3.7.exe' Error: Command failed: "C:\\Users\NKGOO\AppData\Local\Microsoft\WindowsApps\python3.7.exe" "c:\Users\NKGOO\.vscode\extensions\ms-python.python-2021.4.765268190\pythonFiles\pyvsc-run-isolated.py" "c:\Users\NKGOO\.vscode\extensions\ms-python.python-2021.4.765268190\pythonFiles\interpreterInfo.py"
Python was not found but can be installed from the Microsoft Store: ms-windows-store://pdp/?productid=9NJ46SX7X90P
    at ChildProcess.exithandler (child_process.js:312:12)
    at ChildProcess.emit (events.js:315:20)
    at maybeClose (internal/child_process.js:1021:16)
    at Socket.<anonymous> (internal/child_process.js:443:11)
    at Socket.emit (events.js:315:20)
    at Pipe.<anonymous> (net.js:674:12) {
  killed: false,
  code: 9009,
  signal: null,
  cmd: '"C:\\\\Users\\NKGOO\\AppData\\Local\\Microsoft\\WindowsApps\\python3.7.exe" "c:\\Users\\NKGOO\\.vscode\\extensions\\ms-python.python-2021.4.765268190\\pythonFiles\\pyvsc-run-isolated.py" "c:\\Users\\NKGOO\\.vscode\\extensions\\ms-python.python-2021.4.765268190\\pythonFiles\\interpreterInfo.py"'
}
> conda env list

@karthiknadig
Copy link
Member

@Thundercraft5 I am not able to repo this locally. Can you provide logs for this? You can generate logs by setting logToFile to true in the debug configuration. The generated logs should get added to the extension root directory. In your case it should be here c:\Users\NKGOO\.vscode\extensions\ms-python.python-2021.4.765268190

@karthiknadig
Copy link
Member

@Thundercraft5 These logs don't use internalConsole they seem to be set to integratedTerminal. Can you delete the logs and try again to recreate the failing case?

@Thundercraft5
Copy link
Author

@karthiknadig
Copy link
Member

Looks like there are multiple path entries PATH and Path. These should be handled in the debugger, since it is possible to have this on Windows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants