Steps
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
pythonlanguage 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.Fix "Virtual environment is missing"
Python runner unavailable: Virtual environment is missing from this systemmeans 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 plainn8nio/n8nimage. n8n logsFailed to start Python task runner in internal mode.and says internal mode is only for debugging. The supported fix is external mode: run the separaten8nio/runnerscontainer next to n8n (step 4).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 tofalseour Python node failed with the same virtual environment error, and JavaScript still ran in a runner. The settings that matter now areN8N_RUNNERS_MODE(internalorexternal),N8N_RUNNERS_AUTH_TOKENandN8N_PYTHON_ENABLED.Switch to external mode, with a token
Set
N8N_RUNNERS_MODE=externaland the sameN8N_RUNNERS_AUTH_TOKENon n8n and on the runners container, and let the runner reach n8n's broker port (5679 by default; on n8n setN8N_RUNNERS_BROKER_LISTEN_ADDRESS=0.0.0.0in Docker). Without the token every Code node fails withMissing auth token. When `N8N_RUNNERS_MODE` is `external`, it is required to set `N8N_RUNNERS_AUTH_TOKEN`.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 setN8N_RUNNERS_TASK_REQUEST_TIMEOUT=10to 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 node | Settings | Result |
|---|---|---|
| Python | Nothing set (internal mode) | Failed: Python runner unavailable: Virtual environment is missing from this system |
| Python | N8N_RUNNERS_ENABLED=false | Failed with the same error: the variable is ignored in 2.x |
| Python | N8N_RUNNERS_ENABLED=true | Failed with the same error |
Python (legacy python language from 1.x) | Nothing set | Failed with the same error: old Pyodide workflows now need the runner too |
| Python | N8N_PYTHON_ENABLED=false | Failed: This instance disallows Python execution because it has the environment variable `N8N_PYTHON_ENABLED` set to `false`. |
| JavaScript | Nothing set, or N8N_RUNNERS_ENABLED=false | Worked (2 runs): n8n starts the JavaScript runner itself in internal mode |
| JavaScript | N8N_RUNNERS_MODE=external, no token | Failed: Missing auth token. |
| JavaScript and Python | N8N_RUNNERS_MODE=external + token, no runner running | Both 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
- The Python runner has no access to most modules by default. Allowing extra imports is set on the runners container, not on n8n.
- Other 2.x upgrade breakage (env vars denied, Execute Command node gone, file access): n8n 2.x upgrade fixes. JavaScript Code node errors: n8n Code node errors.
- Every error text from our n8n guides is in the n8n error message index.
What we didn't test
- The runners container itself, Python imports inside a working runner, and queue mode workers with runners. The compose file is from n8n's docs, not our runs.
Start from a working agent
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
- n8n expression errors and empty values: 29 tests, every message explained
- n8n MongoDB node errors: Authentication failed, Invalid JSON and query fixes, 40 runs
- n8n Send Email (SMTP) errors: timeouts, 535 Invalid login and SSL fixes, 37 runs
- n8n Telegram node not working? 20 tests, every error decoded
- n8n AI Agent node not working? 18 tests, every error decoded
New guides
- GitHub release notifications in Slack (any public repo, stable releases only)
- Send RSS feeds to Slack with a keyword filter (free, incoming webhook)
- Forward emails to a Slack channel (Gmail, Outlook, any IMAP), free with an incoming webhook
- n8n Google Sheets Trigger not working: not firing, activation errors and fixes