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

Debugger does not work until a Python file is opened #1098

Closed
patrys opened this issue Mar 16, 2018 · 3 comments · Fixed by #1099
Closed

Debugger does not work until a Python file is opened #1098

patrys opened this issue Mar 16, 2018 · 3 comments · Fixed by #1099
Labels
area-debugging bug Issue identified by VS Code Team member as probable bug

Comments

@patrys
Copy link

patrys commented Mar 16, 2018

Environment data

  • VS Code version: 1.22.0-insider
  • Extension version (available under the Extensions sidebar): 2018.2.1
  • OS and version: macOS High Sierra
  • Python version (& distribution if applicable, e.g. Anaconda): Homebrew Python 3.6.4
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): direnv with layout python3
  • Relevant/affected Python packages and their versions: n/a

Actual behavior

I have a project that is half Python/Django and half React. I use VSCode to run/debug the backend part while mostly editing the code for the front-end part. If I attempt to use the debugger before opening a Python file it fails to start.

Expected behavior

Django starts.

Steps to reproduce:

  1. Restart VSCode

  2. Open a TypeScript or JavaScrip file without opening any Python files

  3. Notice that there is no Python interpreter shown in the status bar

  4. Switch to debugger and run the Django configuration

  5. The server fails to start claiming being unable to find the Python executable

    Failed to launch the Python Process, please validate the path '${workspaceFolder}/.direnv/python-3.6.4/bin/python'

Logs

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

Python is not listed under Output.

Output from Console under the Developer Tools panel (toggle Developer Tools on under Help)

/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:1333
   ERR spawn react-native ENOENT: Error: spawn react-native ENOENT
	at exports._errnoException (util.js:1050:11)
	at Process.ChildProcess._handle.onexit (internal/child_process.js:193:32)
	at onErrorNT (internal/child_process.js:367:16)
	at _combinedTickCallback (internal/process/next_tick.js:80:11)
	at process._tickCallback (internal/process/next_tick.js:104:9)
@DonJayamanne
Copy link

Unfortunately the python extension gets activated only when a python file is opened. The problem you've having is simple, the python extension hasn't been activated, and it gets activated when python file is opened.

However, we might have a solution for this issue.

@patrys
Copy link
Author

patrys commented Mar 16, 2018

So starting a debugging session does not activate the extension? I would consider that to be a bug in vscode then.

@DonJayamanne
Copy link

@patrys
If you look above, I've created a PR to resolve this at our end. Basically we'll activate the extension when we start debugging.

@lock lock bot locked as resolved and limited conversation to collaborators Jul 11, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-debugging bug Issue identified by VS Code Team member as probable bug
Projects
None yet
3 participants