// guides · n8n error index

n8n Python Code node not working? Task runner errors, 9 tests

Fix n8n 2.x Python Code node errors: 'Python runner unavailable: Virtual environment is missing', 'Task request timed out', 'Missing auth token', and why N8N_RUNNERS_ENABLED=false changes nothing. From 9 real runs on n8n 2.43.7.

Updated 2026-10-23 · about 10 minutes

Still stuck after these steps? Paste your exact n8n error and we'll reproduce it and email you the fix, free →

Steps

  1. Read the exact error

    In n8n 2.x the Python option of the Code node always runs in a separate task runner (the old in-browser Pyodide Python is gone, and workflows saved with the legacy python language use the runner too). Each error below points to a different cause: no Python runner installed, no runner connected, a missing auth token, or Python switched off.

  2. Fix "Virtual environment is missing"

    Python runner unavailable: Virtual environment is missing from this system means n8n is in internal mode (the default) and tried to start the Python runner itself, but the runner is not installed next to n8n. That is the normal state for an npm install and for the plain n8nio/n8n image. n8n logs Failed to start Python task runner in internal mode. and says internal mode is only for debugging. The supported fix is external mode: run the separate n8nio/runners container next to n8n (step 4).

  3. Stop toggling N8N_RUNNERS_ENABLED

    Many 1.x guides tell you to set N8N_RUNNERS_ENABLED. n8n 2.43.7 no longer reads it: with it set to false our Python node failed with the same virtual environment error, and JavaScript still ran in a runner. The settings that matter now are N8N_RUNNERS_MODE (internal or external), N8N_RUNNERS_AUTH_TOKEN and N8N_PYTHON_ENABLED.

  4. Switch to external mode, with a token

    Set N8N_RUNNERS_MODE=external and the same N8N_RUNNERS_AUTH_TOKEN on n8n and on the runners container, and let the runner reach n8n's broker port (5679 by default; on n8n set N8N_RUNNERS_BROKER_LISTEN_ADDRESS=0.0.0.0 in Docker). Without the token every Code node fails with Missing auth token. When `N8N_RUNNERS_MODE` is `external`, it is required to set `N8N_RUNNERS_AUTH_TOKEN`.

  5. If you see "Task request timed out", the runner never connected

    In external mode with no runner attached, both our JavaScript and Python Code nodes waited and failed with Task request timed out (we set N8N_RUNNERS_TASK_REQUEST_TIMEOUT=10 to make it fail in 10 seconds; the default is 60). Check that the runners container is running, uses the same token, can reach n8n on port 5679, and runs the same version as n8n.

What we ran

On 23 October 2026 we imported three tiny workflows (Manual Trigger, then a Code node returning one item) into n8n 2.43.7 installed with npm, and ran each with n8n execute under different settings. No Python runner was installed, which is what you get from npm or the plain n8n image.

Code nodeSettingsResult
PythonNothing set (internal mode)Failed: Python runner unavailable: Virtual environment is missing from this system
PythonN8N_RUNNERS_ENABLED=falseFailed with the same error: the variable is ignored in 2.x
PythonN8N_RUNNERS_ENABLED=trueFailed with the same error
Python (legacy python language from 1.x)Nothing setFailed with the same error: old Pyodide workflows now need the runner too
PythonN8N_PYTHON_ENABLED=falseFailed: This instance disallows Python execution because it has the environment variable `N8N_PYTHON_ENABLED` set to `false`.
JavaScriptNothing set, or N8N_RUNNERS_ENABLED=falseWorked (2 runs): n8n starts the JavaScript runner itself in internal mode
JavaScriptN8N_RUNNERS_MODE=external, no tokenFailed: Missing auth token.
JavaScript and PythonN8N_RUNNERS_MODE=external + token, no runner runningBoth failed: Task request timed out

So JavaScript works out of the box and Python does not. If you only need a few lines of Python, rewriting them in JavaScript is the quickest fix. If you need Python, run the runners container.

Docker Compose for external mode

services:
  n8n:
    image: docker.n8n.io/n8nio/n8n:2.43.7
    environment:
      - N8N_RUNNERS_MODE=external
      - N8N_RUNNERS_AUTH_TOKEN=change-me-long-random
      - N8N_RUNNERS_BROKER_LISTEN_ADDRESS=0.0.0.0
  runners:
    image: n8nio/runners:2.43.7   # same version as n8n
    environment:
      - N8N_RUNNERS_TASK_BROKER_URI=http://n8n:5679
      - N8N_RUNNERS_AUTH_TOKEN=change-me-long-random
    depends_on: [n8n]

This block follows n8n's task runner docs; we did not run Docker for this guide. The runners image contains both the JavaScript and the Python runner.

Good to know

What we didn't test

FAQ

Why does n8n say Python runner unavailable: Virtual environment is missing?

n8n 2.x runs Python in a separate task runner. In internal mode it tries to start one from its own install, and npm installs and the plain n8n Docker image don't include it. Run the n8nio/runners container in external mode, or rewrite the code in JavaScript.

Does N8N_RUNNERS_ENABLED still work in n8n 2.x?

No. n8n 2.43.7 does not read it. Setting it to false or true changed nothing in our runs. Use N8N_RUNNERS_MODE (internal or external) instead.

Why does my n8n Code node say Task request timed out?

n8n is in external runner mode and no runner picked up the task. Start the n8nio/runners container with the same N8N_RUNNERS_AUTH_TOKEN and make sure it can reach n8n on port 5679.

Can I still use Pyodide Python in n8n?

No. In n8n 2.x, Code nodes saved with the old python language also run in the native Python runner and fail with the same error if it is missing.

How do I turn off Python in the n8n Code node?

Set N8N_PYTHON_ENABLED=false. Python Code nodes then fail with 'This instance disallows Python execution', and JavaScript keeps working.

Related guides

New guides

Still stuck on your n8n error?

Paste the exact error and say what the workflow should do. We reproduce it on a real n8n install and email you the fix or a working workflow, usually within 24h. Free while we're in beta.

We'll only email you about your error and TaskToAgent.