Python runner unavailable

Python runner unavailable: Virtual environment is missing from this system at ExecuteContext.execute

Installed n8n on AWS EKS with a docker Image
Docker file 
*****
FROM n8nio/n8n:2.0.3
USER root
RUN apk add --no-cache python3 py3-pip aws-cli git jq bash
RUN pip3 install --break-system-packages boto3 PyYAML
USER node
****

Environment variables
DB_TYPE=sqlite
N8N_PROTOCOL=http
N8N_PORT=5678
N8N_RUNNERS_ENABLED=true
N8N_RUNNERS_MODE=internal
N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=true
N8N_EDITOR_BASE_URL=https://n8n.ccg-.net
WEBHOOK_URL=https://n8n.ccg-.net/
N8N_TEMPLATES_ENABLED=true
EXECUTIONS_MODE=regular
EXECUTIONS_DATA_SAVE_ON_ERROR=all
EXECUTIONS_DATA_SAVE_ON_SUCCESS=all
EXECUTIONS_DATA_SAVE_MANUAL_EXECUTIONS=true
EXECUTIONS_DATA_SAVE_ON_PROGRESS=true
EXECUTIONS_DATA_PRUNE=false
N8N_COMMUNITY_PACKAGES_ENABLED=false
N8N_SECURE_COOKIE=false
N8N_BASIC_AUTH_ACTIVE=false
AWS_STS_REGIONAL_ENDPOINTS=regional
AWS_DEFAULT_REGION=us-east-1
AWS_REGION=us-east-1
AWS_ROLE_ARN=arn:aws:iam::<>:role/n8n-sso-role
AWS_WEB_IDENTITY_TOKEN_FILE=/var/run/secrets/eks.amazonaws.com/serviceaccount/token

What is the error message (if any)?

Error: Python runner unavailable: Virtual environment is missing from this system at ExecuteContext.execute (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-nodes-base@file+packages+nodes-base_@aws-sdk+credential-providers@3.808.0_asn1.js@5_8da18263ca0574b0db58d4fefd8173ce/node_modules/n8n-nodes-base/nodes/Code/Code.node.ts:159:11) at WorkflowExecute.executeNode (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@opentelemetry+api@1.9.0_@opentelemetry+sdk-trace-base@1.30_ec37920eb95917b28efaa783206b20f3/node_modules/n8n-core/src/execution-engine/workflow-execute.ts:1045:31) at WorkflowExecute.runNode (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@opentelemetry+api@1.9.0_@opentelemetry+sdk-trace-base@1.30_ec37920eb95917b28efaa783206b20f3/node_modules/n8n-core/src/execution-engine/workflow-execute.ts:1226:22) at /usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@opentelemetry+api@1.9.0_@opentelemetry+sdk-trace-base@1.30_ec37920eb95917b28efaa783206b20f3/node_modules/n8n-core/src/execution-engine/workflow-execute.ts:1662:38 at /usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@opentelemetry+api@1.9.0_@opentelemetry+sdk-trace-base@1.30_ec37920eb95917b28efaa783206b20f3/node_modules/n8n-core/src/execution-engine/workflow-execute.ts:2274:11

Please share your 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:

hi @mnk21

Installing Python inside the container is not enough for the Code in Python node.

In n8n 2.x, this node requires a Python runner with a managed virtual environment, and that environment is missing in your setup — which is exactly what the error message indicates.

Even though python3 and pip are installed, the native Python runner is not initialized just by adding Python to the image.

Your options are:

  • Use JavaScript in the Code node (simplest)
  • Run Python via Execute Command / external service
  • Set up a supported Python runner / external runner per the n8n docs

Hi @mnk21

This compose file works well for me. n8n/migration-n8n-v2/docker-compose.yml at main · Mohammedaljer/n8n · GitHub

Hi! I had similar issue when tried to deploy n8n on render and managed to solve it after some deep debugging.

The Root Cause:
The problem is that the official n8n Docker image (specifically around v2.7.x and v2.8.3) is actually missing the source code for the @n8n/task-runner-python package in the node_modules directory. Since the source code isn’t there, n8n cannot automatically create the .venv it needs for the internal mode, no matter how you install Python in your Dockerfile.

Basically, n8n is trying to run a script that simply doesn’t exist in the official image.

Fixed: self hosted n8n v2.8.3 Python Task Runner on Render.com

I’ve reverse-engineered the issues and found a way to “patch” the image by manually injecting the missing source code from n8n’s GitHub repository and setting up the environment correctly.

If you want a deployment that works out of the box with Python (and includes pandas/requests), I’ve shared the instructions and a one-click deploy button here:

https://github.com/api29200/n8n_v2.8.3-render-python

It fixes the permission errors, restores the missing environment files, and handles the virtual environment creation that n8n expects. Even if you are not using Render, you can check my Dockerfile in that repo to see how to properly restore the missing runner files to your own image.