N8n ignores N8N_PYTHON_EXECUTABLE on Ubuntu 24.04 with systemd, falls back to Pyodide

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:**

  1. The virtual environment exists at /opt/n8n/venv and PyMuPDF is successfully installed inside it.
  2. 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
  3. 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 the sys.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.

Hey @mohsen_ehsani,

The code node will only use Pyodide it doesn’t know about the OS python binaries. N8N_PYTHON_EXECUTABLE is also not one of our config keys, Is it safe to assume that you have maybe asked an AI model for help and it is told you it is possible and you need to set that?

I am also not sure what N8N_EXECUTION_PROCESS I can’t find a reference to that in our codebase so it could be another option to remove.

Other than that I would also recommend using the Docker image for running n8n as we have been talking about not supporting direct npm based installed in the future.