The VS Code error "Error: spawn python ENOENT" typically occurs when Visual Studio Code is unable to locate the Python executable on the machine. You may see it written slightly differently depending on the extension that triggers it — spawn py ENOENT, spawn python3 ENOENT, or just a generic spawn ENOENT in VS Code — but the cause and fix are the same in almost every case.

The full error from the logs:

originalException: [Error: spawn python ENOENT
      at ChildProcess._handle.onexit (node:internal/child_process:283:19)
      at onErrorNT (node:internal/child_process:478:16)
      at process.processTicksAndRejections (node:internal/process/task_queues:83:21)] {
	errno: -2,
	code: 'ENOENT',
	syscall: 'spawn python',
	path: 'python',
	spawnargs: [

and

	interpreter: undefined,
	id: '.python3./python./.-m#ipykernel_launcher'

What does "spawn ENOENT" mean?

ENOENT stands for "Error NO ENTry" — it's a standard Node.js/POSIX error code meaning the operating system couldn't find the file or command you tried to run. When VS Code (or one of its extensions) tries to spawn a process — say, to start a Python interpreter, run a linter, or launch a formatter — it asks the OS to execute a command by name. If that command isn't found anywhere on the system PATH, the OS hands back ENOENT, and VS Code reports it as Error: spawn <command> ENOENT.

This is why the exact wording changes depending on what's missing:

  • Error: spawn python ENOENT — VS Code looked for python and didn't find it
  • Error: spawn py ENOENT — same issue, but the extension tried the Windows py launcher instead
  • Error: spawn python3 ENOENT — same issue, looking for python3 specifically (common on Linux/Mac where only python3 exists, not python)

The fix below focuses on Python, since that's the most common trigger, but the underlying cause — a missing or misconfigured executable on PATH — is identical for any spawn <something> ENOENT error in VS Code, including ones unrelated to Python (for example, spawn pandoc ENOENT if a Markdown/Pandoc extension can't find Pandoc, or spawn dot ENOENT if a Graphviz-based extension can't find the dot command). In those cases, swap "Python" for the missing tool in the steps below: verify it's installed, confirm it's on PATH, and point the relevant extension setting at the correct executable path.

Fix spawn python ENOENT

Here are a few steps you can try to resolve the issue:

Verify Python installation

Verify that Python is installed on your computer by opening a command prompt or terminal in VS Code and typing:

python -V

If Python is installed, you should see the version number and a prompt:

Python 3.8.10

If you see something like: Command 'python' not found, did you mean then you need to install Python.

On some systems — particularly Linux and macOS — only python3 is installed, not python. If python -V fails but you suspect Python is installed, also try:

python3 -V

On Windows, Python is often invoked through the py launcher instead. If an extension is reporting spawn py ENOENT, check that the launcher works directly:

py -V

If none of python, python3, or py resolve, Python isn't installed (or isn't on PATH) and you'll need to install it from python.org or your system's package manager.

Install Jupyter

If you try to run code from a Jupyter notebook then you need to install Jupyter notebook by:

pip install jupyter
pip install jupyterlab

In some cases an upgrade of the package pyzmq is needed:

pip install --upgrade pyzmq

or reinstall it:

pip uninstall pyzmq
pip install pyzmq

Create a virtualenv

If there are multiple versions of Python installed on the computer, try specifying the path to the specific version you want to use in the settings.

In case of multiple Python versions, use virtual environments. To create a new one or select an existing virtual environment in VS Code:

  • Open the Command Palette with CTRL + Shift + P
    • Python: Select Interpreter
      • select an existing environment
    • Python: Create Environment
      • select venv or conda
      • select the base interpreter path

Reasons for Error: spawn python ENOENT

The error "spawn python ENOENT" can happen if:

  • Python (or python3, or the py launcher) is not properly installed on your computer
  • The path to the Python executable is not included in the system's PATH environment variable
  • The path to the Python executable is not configured correctly in Visual Studio Code's settings
  • A VS Code extension is hardcoded to call python (or python3, or py) specifically, and that exact command name isn't the one available on your system

Fixing "spawn ENOENT" for other commands (Pandoc, Graphviz, etc.)

The same ENOENT error shows up for plenty of non-Python tools that VS Code extensions try to spawn. A couple of common variants:

  • Exec error: Error: spawn pandoc ENOENT — usually thrown by Markdown preview or document-conversion extensions that shell out to Pandoc. Install Pandoc, confirm it's on PATH with pandoc -v, and if needed set the extension's Pandoc path setting explicitly.
  • spawn dot ENOENT — thrown by Graphviz-based extensions (diagram/preview tools) that call the dot command. Install Graphviz, confirm it's on PATH with dot -V, and check the extension's settings for a path override.

In both cases, the diagnosis steps are the same ones used for Python: confirm the tool is installed, confirm it's reachable on PATH from a regular terminal, and confirm the relevant VS Code extension setting points at the right executable.

More on Error: spawn python ENOENT

Additionally, you can check:

  • That the path to the Python executable is included in the system's PATH environment variable. You can check this by running:

Mac/Linux

echo $PATH

Windows

echo %PATH%
  • In VS Code, go to Settings and check the python.pythonPath (or, in newer versions, the interpreter set via Python: Select Interpreter). Make sure it points to the correct location of your Python executable.
  • Reinstall Python and make sure to check the option to add Python to PATH during setup (on Windows, this is a checkbox on the installer's first screen).
  • Restart VS Code completely after making any PATH or interpreter changes — VS Code caches the environment it was launched with and won't always pick up changes automatically.