N8n: Missingdistutils module on Debian 13 (Python 3.12+) #1969

Closed
opened 2026-02-05 03:07:25 +03:00 by OVERLORD · 0 comments
Owner

Originally created by @chrikodo on GitHub (Nov 9, 2025).

Have you read and understood the above guidelines?

yes

📜 What is the name of the script you are using?

n8n

📂 What was the exact command used to execute the script?

bash <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/ct/n8n.sh)

⚙️ What settings are you using?

  • Default Settings
  • Advanced Settings

🖥️ Which Linux distribution are you using?

Debian 13

📈 Which Proxmox version are you on?

8.4.14

📝 Provide a clear and concise description of the issue.

The n8n installation script fails on Debian 13 (Python 3.12+) when installing n8n, specifically during the compilation of the sqlite3 npm package. The error occurs because Python 3.12+ no longer includes the distutils module, which is required by node-gyp for native module compilation.

🔄 Steps to reproduce the issue.

  1. Create a new LXC container using Debian 13 template
  2. Run the n8n installation script:
    bash <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/ct/n8n.sh)
    
  3. The script installs dependencies and Node.js successfully
  4. When npm install -g n8n runs, it attempts to compile sqlite3
  5. The compilation fails with: ModuleNotFoundError: No module named 'distutils'

Paste the full error output (if available).

gyp ERR! stack Error: Command failed: /usr/bin/python3 -c import sys; print "%s.%s.%s" % sys.version_info[:3]
gyp ERR! stack ModuleNotFoundError: No module named 'distutils'
gyp ERR! stack     at Module._compile (node:internal/modules/cjs/loader:1374:7)
gyp ERR! stack     at Object.Module._extensions..js (node:internal/modules/cjs/loader:1427:10)
gyp ERR! stack     at Module.load (node:internal/modules/cjs/loader:1207:32)
gyp ERR! stack     at Function.Module._load (node:internal/modules/cjs/loader:1030:12)
gyp ERR! stack     at Module.require (node:internal/modules/cjs/loader:1235:19)
gyp ERR! stack     at require (node:internal/modules/cjs/helpers:130:18)

🖼️ Additional context (optional).

Root Cause

Python 3.12+ (used in Debian 13) removed the distutils module from the standard library. The distutils functionality has been moved to the setuptools package, which needs to be explicitly installed.

Solution

The fix requires adding python3-setuptools to the dependencies in install/n8n-install.sh. This package provides the distutils module that node-gyp requires for compiling native Node.js modules like sqlite3.

Current Dependencies

$STD apt install -y \
  ca-certificates \
  build-essential

Required Dependencies

$STD apt install -y \
  ca-certificates \
  build-essential \
  python3 \
  python3-setuptools

References

Originally created by @chrikodo on GitHub (Nov 9, 2025). ### ✅ Have you read and understood the above guidelines? yes ### 📜 What is the name of the script you are using? n8n ### 📂 What was the exact command used to execute the script? bash <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/ct/n8n.sh) ### ⚙️ What settings are you using? - [x] Default Settings - [ ] Advanced Settings ### 🖥️ Which Linux distribution are you using? Debian 13 ### 📈 Which Proxmox version are you on? 8.4.14 ### 📝 Provide a clear and concise description of the issue. The n8n installation script fails on Debian 13 (Python 3.12+) when installing n8n, specifically during the compilation of the sqlite3 npm package. The error occurs because Python 3.12+ no longer includes the `distutils` module, which is required by node-gyp for native module compilation. ### 🔄 Steps to reproduce the issue. 1. Create a new LXC container using Debian 13 template 2. Run the n8n installation script: ```bash bash <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/ct/n8n.sh) ``` 3. The script installs dependencies and Node.js successfully 4. When `npm install -g n8n` runs, it attempts to compile sqlite3 5. The compilation fails with: `ModuleNotFoundError: No module named 'distutils'` ### ❌ Paste the full error output (if available). ``` gyp ERR! stack Error: Command failed: /usr/bin/python3 -c import sys; print "%s.%s.%s" % sys.version_info[:3] gyp ERR! stack ModuleNotFoundError: No module named 'distutils' gyp ERR! stack at Module._compile (node:internal/modules/cjs/loader:1374:7) gyp ERR! stack at Object.Module._extensions..js (node:internal/modules/cjs/loader:1427:10) gyp ERR! stack at Module.load (node:internal/modules/cjs/loader:1207:32) gyp ERR! stack at Function.Module._load (node:internal/modules/cjs/loader:1030:12) gyp ERR! stack at Module.require (node:internal/modules/cjs/loader:1235:19) gyp ERR! stack at require (node:internal/modules/cjs/helpers:130:18) ``` ### 🖼️ Additional context (optional). ### Root Cause Python 3.12+ (used in Debian 13) removed the `distutils` module from the standard library. The `distutils` functionality has been moved to the `setuptools` package, which needs to be explicitly installed. ### Solution The fix requires adding `python3-setuptools` to the dependencies in `install/n8n-install.sh`. This package provides the `distutils` module that node-gyp requires for compiling native Node.js modules like sqlite3. ### Current Dependencies ```bash $STD apt install -y \ ca-certificates \ build-essential ``` ### Required Dependencies ```bash $STD apt install -y \ ca-certificates \ build-essential \ python3 \ python3-setuptools ``` ### References - Python 3.12 release notes: https://docs.python.org/3.12/whatsnew/3.12.html#removed - PEP 632: https://peps.python.org/pep-0632/ - Debian 13 release: https://www.debian.org/releases/bookworm/
OVERLORD added the bug label 2026-02-05 03:07:25 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/ProxmoxVE#1969