Hello,
I am running a self-hosted n8n instance (v1.98.1) on Ubuntu 24.04 LTS, managed by a systemd service. I am trying to use a Python library with C-dependencies (
PyMuPDF
) and have configured my instance to use a dedicated virtual environment.The Problem: Despite correct configuration, the n8n Code Node continues to run in Pyodide mode, ignoring the environment variables set in the systemd service file.
My
n8n.service
file:
[Unit] Description=n8n workflow automation After=network.target
[Service] Type=simple User=root ExecStart=/usr/bin/n8n Restart=on-failure RestartSec=10 Environment=“N8N_EXECUTION_PROCESS=separate” Environment=“N8N_PYTHON_EXECUTABLE=/opt/n8n/venv/bin/python”
[Install] WantedBy=multi-user.target
**Verification Steps:**
- The virtual environment exists at
/opt/n8n/venv
andPyMuPDF
is successfully installed inside it.- The command
systemctl show n8n | grep Environment=
confirms that systemd is aware of the variables:Environment=N8N_EXECUTION_PROCESS=separate N8N_PYTHON_EXECUTABLE=/opt/n8n/venv/bin/python
- Despite this, running any Python code in a Code Node that tries to access the filesystem (e.g., using
subprocess
) fails with Pyodide/Emscripten errors (emscripten does not support processes.
), and thesys.path
inside the node points to/home/pyodide
.
It seems the n8n process is not respecting the environment variables passed by systemd in this environment. Any help would be appreciated.
Thank you.