Describe the problem/error/question
Dear n8n Community,
I’m writing to you today as a very enthusiastic n8n user. I’ve been incredibly impressed with n8n’s capabilities and ease of use for automating workflows, and I continue to be a big fan of the platform!
I was particularly excited about the introduction of the new “external” runners method for Python, as it promised to open up a lot of possibilities for more complex data processing and custom logic directly within n8n. The idea of offloading Python execution to dedicated runners is a fantastic architectural improvement.
However, I must admit, I’m feeling a bit disheartened and frankly, quite a bit frustrated with the setup process for these external Python runners. After multiple hours of trying, debugging, and following various paths, I still haven’t managed to get my Python nodes to recognize external libraries like requests, numpy, pandas.
Here’s a summary of what I’ve tried so far in my Portainer stack (n8n-postgres), using n8nio/n8n:1.118.1 for both the main n8n instance and the custom runner image:
-
Custom Dockerfile (
task-runners-image/Dockerfile):-
Initially, I tried to build a custom runner image based on
docker.n8n.io/n8nio/n8n:1.118.1. -
I attempted to
RUN pip install requests numpy pandas oipddirectly within the Dockerfile. -
I also tried to create and
COPYextras.txt(containing the package list) andn8n-task-runners.json(to allow external modules) into/etc/in the runner image. -
Result: The Docker build for the runner image now completes successfully, meaning the files are copied and
pip installcommands (when present in the Dockerfile) execute without error. Mypip freezeoutput from inside the running runner container (docker exec -it n8n-runners bashfollowed bypip freeze) clearly showsrequests,numpy,pandasas installed in/usr/local/lib/python3.13/site-packages.
-
-
Manual
pip installwithin the Running Runner Container:-
After the Docker build, I manually exec’d into the running
n8n-runnerscontainer (docker exec -it n8n-runners bash). -
From within the container, I executed
pip install requests numpy pandas. -
My
pip freezeoutput from inside the container confirmed these packages were successfully installed in/usr/local/lib/python3.13/site-packages. -
Result: Despite confirming the packages are installed in the container’s system-wide Python environment, my Python nodes in n8n still report “No module named ‘requests’”. This strongly suggests that the Python environment used by the n8n Python node is completely isolated and does not pick up these system-wide installations.
-
I’m at a loss for what to try next. It feels like the Python runner is either ignoring these configurations, or there’s a subtle interaction I’m missing between the main n8n instance and the external runner regarding Python environment setup.
My intended solution (and what I hoped for) was indeed to enable package installation via environment variables or a clear, documented process in the Dockerfile for external runners. It would be incredibly helpful to have a straightforward way to ensure these essential packages are available.
Could anyone in the community shed some light on this or provide a working example for configuring external Python runners with additional packages? Any guidance would be immensely appreciated.
Thank you for your time and for this amazing platform!
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.)