N8N Code Node wants Python 3 installed on the system. I have it, but n8n does not see it

Describe the problem/error/question

I recently updated to n8n v2.1.4 via npm on Windows. I am trying to use the Code Node with Python, but it refuses to run, giving a “Python runner unavailable” error.

I have:

  1. Installed Python 3.13 (and tried 3.10 previously).

  2. Verified python --version works in my terminal.

  3. Verified Python is in my System and User PATH.

  4. Tried setting the environment variable N8N_PYTHON_BINARY to the full path of my python executable (C:\Users\…\python.exe).

  5. Restarted the terminal and n8n multiple times.

It seems the native task runner cannot locate the binary on Windows npm installs. Is there a specific configuration for Windows execution that I am missing?

Did anyone have the same issue? And if so, how did you solve it?

PS: I could find any information regarding this in the docs.

What is the error message (if any)?

Python runner unavailable: Python 3 is missing from this system
Internal mode is intended only for debugging. For production, deploy in external mode: https://docs.n8n.io/hosting/configuration/task-runners/#setting-up-external-mode

Please share your workflow

Information on your n8n setup

    • n8n version: 2.1.4

    • Database (default: SQLite): SQLite (Default)

    • n8n EXECUTIONS_PROCESS setting (default: own, main): default

    • Running n8n via (Docker, npm, n8n cloud, desktop app): npm

    • Operating system: Windows 11

    • Python Version: 3.10/3.13/3.14 (Added to PATH)

Welcome to the community :tada: @ExitCode-0

Regarding your question, the n8n app can’t find your Python program on windows because it runs in the background and doesn’t look in the same places as your terminal.

Here are your two best options:

  1. Set a special system variable called N8N_PYTHON_BINARY to point directly to your python.exe file (like C:\Python\python.exe) and then restart your computer.
  2. Run pip install n8n-python in your terminal, change the Code Node’s mode to “External”, and restart n8n. This is the most reliable way.

Hope this helps!

2 Likes

Thanks I will try it:)

You are welcome @ExitCode-0 let me know if you have any questions.

Hey again. It did not work. I put 3.10 in the user PATH. In the appdata local part. then I restarted my computer and tried running the command “pip install n8n-python” it gave me this output:

ERROR: Could not find a version that satisfies the requirement n8n-python (from versions: none)
ERROR: No matching distribution found for n8n-python

Any info on this?
PATH is set correctly:

Same problem here. The sys variable and pip install doesn’t fix mine either.

yeah even though I have multiple python’s installed on the system

So what should I do? You just described the changes but did not really explain how to solve the problem. Do you mean that I should add/update the .env file in .n8n?

If you’re running n8n in Docker and get the “Python 3 is missing from this system” error, it usually means n8n is trying to run Python in internal mode, but modern n8n (2.x+) executes Python via external task runners instead — so having Python on the host doesn’t help.

To fix it, run a task runner container and wire it to n8n via the broker. Key points:

  • Use a matching runner image, e.g. n8nio/runners:<same n8n version>

  • Configure external mode on n8n:

    N8N_RUNNERS_ENABLED=true
    N8N_RUNNERS_MODE=external
    N8N_RUNNERS_BROKER_LISTEN_ADDRESS=0.0.0.0
    N8N_RUNNERS_BROKER_PORT=5679
    N8N_NATIVE_PYTHON_RUNNER=true
    
    
  • Configure the runner:

    N8N_RUNNERS_PYTHON_ENABLE=true
    N8N_RUNNERS_TASK_BROKER_URI=http://n8n:5679
    
    
  • Set the same N8N_RUNNERS_AUTH_TOKEN on both n8n and the runner

  • Make sure the runner can resolve http://n8n:5679 via Docker DNS

If this wiring is missing, n8n falls back to internal mode, doesn’t find Python in the n8n container, and shows that error.

Official docs with the full setup are here:
https://docs.n8n.io/hosting/configuration/task-runners/#setting-up-external-mode

After setting up the runner + broker, Python Code nodes should work normally.

I appreciate the help. I am in fact self-hosting via docker compose and came across this problem. I set up the task-runners instance in my compose.yaml and edited as you suggested (and the n8n docs said). Im still getting the error that python 3 is not available and n8n is running in internal mode. Do you know what else I could do? are how I can check if the runner can resolve the broker uri? Many Thanks

Hi everyone! For reference, I want to share my setup that’s working well for me. It shows how to run n8n with both JavaScript and Python task runners using Docker and docker-compose. Feel free to adjust it to fit your own needs.

Please take note that I used custom n8n docker image (Docker.n8n) to install Python so I can also use “Execute” node aside from “Code” node to run Python.

use custom N8N image for “Execute” node and task-runners for “Code” node

Folder Structure

local/
├── .env
├── docker-compose.yml
├── Dockerfile.n8n
├── Dockerfile.runners
└── n8n-task-runners.json

.env

# Secret token used by n8n task runners to authenticate with the n8n server
# Replace with a strong, random value and do NOT commit to version control
N8N_RUNNERS_AUTH_TOKEN=REPLACE_WITH_A_STRONG_SECRET

docker-compose.yml

services:
  n8n:
    image: custom-n8n
    build:
      context: .
      dockerfile: Dockerfile.n8n
    container_name: n8n-main
    restart: unless-stopped
    ports:
      - "5678:5678"
    environment:
      - N8N_RUNNERS_ENABLED=true
      - N8N_RUNNERS_MODE=external
      - N8N_RUNNERS_AUTH_TOKEN=${N8N_RUNNERS_AUTH_TOKEN}
      - N8N_NATIVE_PYTHON_RUNNER=true
      - N8N_RUNNERS_BROKER_ENABLED=true
      - N8N_RUNNERS_BROKER_PORT=5679
      - N8N_RUNNERS_BROKER_LISTEN_ADDRESS=0.0.0.0
      - N8N_BLOCK_ENV_ACCESS_IN_NODE=true
      - N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=true
      - NODES_EXCLUDE=[]
    volumes:
      - n8n_data:/home/node/.n8n

  task-runners:
    image: custom-n8n-runner
    build:
      context: .
      dockerfile: Dockerfile.runners
    container_name: runner
    restart: always
    environment:
      - N8N_RUNNERS_TASK_BROKER_URI=http://n8n-main:5679
      - N8N_RUNNERS_AUTH_TOKEN=${N8N_RUNNERS_AUTH_TOKEN}
    depends_on:
      - n8n

volumes:
  n8n_data:
    external: true


Dockerfile.n8n

FROM n8nio/n8n:2.4.1

# Copy apk binary and libs from Alpine
COPY --from=alpine:3.23 /sbin/apk /sbin/apk
COPY --from=alpine:3.23 /usr/lib/libapk.so* /usr/lib/

USER root

# Install build tools, python, pip, and Python packages; then clean up apk and temporary tools
RUN set -eux; \
    apk add --no-cache build-base python3 py3-pip ffmpeg; \
    pip3 install --break-system-packages pandas numpy requests yt-dlp; \
    apk del build-base; \
    rm -f /sbin/apk /usr/lib/libapk.so*; \
    rm -rf /var/cache/apk/*

USER node


Dockerfile.runners

FROM n8nio/runners:2.4.1

USER root

# --------------------------------------------
# Optional: Install additional JavaScript modules
# --------------------------------------------
# RUN cd /opt/runners/task-runner-javascript && \
#     pnpm uuid

# --------------------------------------------
# Optional: Install additional Python modules
# --------------------------------------------
# RUN cd /opt/runners/task-runner-python && \
#     uv pip install numpy pandas yt-dlp

# --------------------------------------------
# Copy custom task runner configuration
# --------------------------------------------
COPY n8n-task-runners.json /etc/n8n-task-runners.json

# Switch back to the default runner user for security
USER runner


n8n-task-runners.json

{
  "task-runners": [
    {
      "runner-type": "javascript",
      "workdir": "/home/runner",
      "command": "/usr/local/bin/node",
      "args": [
        "--disallow-code-generation-from-strings",
        "--disable-proto=delete",
        "/opt/runners/task-runner-javascript/dist/start.js"
      ],
      "health-check-server-port": "5681",
      "allowed-env": [
        "PATH",
        "GENERIC_TIMEZONE",
        "NODE_OPTIONS",
        "N8N_RUNNERS_AUTO_SHUTDOWN_TIMEOUT",
        "N8N_RUNNERS_TASK_TIMEOUT",
        "N8N_RUNNERS_MAX_CONCURRENCY",
        "N8N_SENTRY_DSN",
        "N8N_VERSION",
        "ENVIRONMENT",
        "DEPLOYMENT_NAME",
        "HOME"
      ],
      "env-overrides": {
        "NODE_FUNCTION_ALLOW_BUILTIN": "",
        "NODE_FUNCTION_ALLOW_EXTERNAL": ""
      }
    },
    {
      "runner-type": "python",
      "workdir": "/home/runner",
      "command": "/opt/runners/task-runner-python/.venv/bin/python",
      "args": ["-m", "src.main"],
      "health-check-server-port": "5682",
      "allowed-env": [
        "PATH",
        "N8N_RUNNERS_LAUNCHER_LOG_LEVEL",
        "N8N_RUNNERS_AUTO_SHUTDOWN_TIMEOUT",
        "N8N_RUNNERS_TASK_TIMEOUT",
        "N8N_RUNNERS_MAX_CONCURRENCY",
        "N8N_SENTRY_DSN",
        "N8N_VERSION",
        "ENVIRONMENT",
        "DEPLOYMENT_NAME"
      ],
      "env-overrides": {
        "PYTHONPATH": "/opt/runners/task-runner-python",
        "N8N_RUNNERS_STDLIB_ALLOW": "*",
        "N8N_RUNNERS_EXTERNAL_ALLOW": ""
      }
    }
  ]
}


Some Useful References:

This usually isn’t about Python not being installed it’s about how n8n is running.

The n8n Code node only detects Python if it’s available inside the same environment/container that n8n runs in.

Common cases:

  • Docker / Docker Compose → Python on your host machine is invisible to n8n

  • PM2 / system service → PATH doesn’t include Python

  • Self-hosted binary → Python not on the runtime PATH

How to fix it:

  • If using Docker: you must install Python inside the container (or use an image that includes it)

  • If running n8n natively: ensure python3 is on the PATH and restart n8n

    python3 --version
    which python3
    
    
  • You can also explicitly set:

    N8N_PYTHON_PATH=/usr/bin/python3
    
    

Bottom line: n8n doesn’t “see” your system Python unless it exists in the same execution environment.

[email protected]