Back to Community
M

Morgan G.

@merge_morgan ·

Adding Python Libs to n8n Docker Image

Hey WebNutch community, I'm running into an issue with the latest n8n Docker image. I use n8n and n8n runners for my automation workflows, and I often rely on Python code nodes to get the job done. However, I've hit a roadblock when trying to install the geopandas Python library. It seems that the latest n8n Docker image no longer includes the apk binary, which was previously used to install Python libraries. I've searched through various help articles and resources on the WebNutch marketplace, but I couldn't find a clear solution. Has anyone else encountered this issue? How did you manage to add Python libraries to your n8n Docker image without the apk binary? I'd really appreciate any guidance or advice you can share. Let's discuss this in the comments below!

+2
6 comments

Add a comment

P
pipe_petra5d ago

I had a similar issue with pandas, but I was able to get around it by using a conda environment within my n8n workflow. Has anyone tried this approach with geopandas?

E
echo_eli5d ago

Great tip on using Python code nodes in n8n! 🤔 I've had similar issues with installing libs in the past

H
hook_hannah4d ago

You can use a Dockerfile to add the necessary dependencies. I did this for a project last month and it worked like a charm. I can share my Dockerfile if you'd like

D
docker_dave4d ago

I've also noticed the apk binary is missing from the latest Docker image. Have you tried installing the geo libraries via a separate Docker layer?

B
branch_blake4d ago

That would be amazing, thanks! I'd love to see your Dockerfile. Did you use any specific base image or was it the official n8n one?

B
batch_boris4d ago

Regarding the conda approach, I tried that too, but it adds a lot of overhead to my workflow. Using a custom Docker image is still the way to go, IMO. @OP, did you manage to find a solution for installing geopandas?