Python runner unavailable in n8n (Python 3 is missing from this system) – Docker / Alpine container

<!-Hello everyone,
I am running n8n on a VPS (Ubuntu 24.04). n8n is running inside a Docker container, and it appears to be Alpine-based.
I am having an issue with the Python node. When I try to execute it, I receive the following error:
Python runner unavailable: Python 3 is missing from this system
I have already installed Python 3 on the root system of my VPS, and I can run it manually from the server without any problem. However, n8n does not detect it, and the Python node still does not work.
From what I understand, the n8n container environment is isolated, and it seems Python is not installed inside the container itself. Since the container is Alpine-based, I am not sure what is the correct and recommended way to enable Python support.
My questions:
What is the proper way to enable Python inside the official n8n Docker container?
Do I need to create a custom Docker image that includes Python?
Is there any recommended guide or video tutorial that explains how to properly configure this setup?
I would really appreciate any guidance or documentation that can help me solve this issue.
Thank you in advance.- Hey! The fastest way to find solutions is by using the :magnifying_glass_tilted_right: search function at the upper right.
If your question hasn’t been asked before, please follow the template below. Skip the questions that are not relevant to you. →

Describe the problem/error/question

What is the error message (if any)?

Please share your workflow

(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)

Share the output returned by the last node

Information on your n8n setup

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:
1 Like

Hi! This is a common issue when running n8n in the official Docker image, which is Alpine-based and does not include Python by default.

You have two main options:

Option 1: Create a custom Dockerfile (recommended)

Create a Dockerfile that extends the official n8n image and installs Python:

FROM n8nio/n8n:latest

USER root

RUN apk add --no-cache python3 py3-pip

USER node

Then build and run your custom image:

docker build -t n8n-python .
docker run -it --rm -p 5678:5678 n8n-python

Option 2: Use docker-compose with an init command

If you use docker-compose, you can add a command to install Python on startup (less ideal but works for testing):

services:
  n8n:
    image: n8nio/n8n
    user: root
    command: >
      sh -c "apk add --no-cache python3 py3-pip && su node -s /bin/sh -c 'n8n'"

Important notes:

  • Make sure you use python3 and pip3 in your Code nodes, as the Alpine package is python3, not python
  • The N8N_RUNNERS_ENABLED=true environment variable may be needed for the Python task runner in newer versions
  • For production, Option 1 (custom Dockerfile) is always the better approach

Hope this helps!

2 Likes

Hi @MOHAMMED_ABDALELAH_M
Welcome to the n8n community :tada:
You are installing the dependency in the wrong place. You need to create a custom image based on the official n8n image and install Python using apk. Creating a custom Docker image is the correct approach and considered best practice in this scenario.

The n8n documentation explains how to build a custom image here: Docker | n8n Docs
Unfortunately, there is no official n8n image that comes with Python preinstalled.

2 Likes

Hi,

the apk package manager has been removed from the official n8n Docker images. However, you can find a solution to copy it from Alpine Linux in the following community thread:

1 Like