naskio / n8n-nodes-python

Run Python code on n8n
https://www.npmjs.com/package/n8n-nodes-python
Other
89 stars 12 forks source link

Can't import pdf2image library (but Requirement already satisfied: pdf2image when pip install) #17

Open omkom opened 4 weeks ago

omkom commented 4 weeks ago

Hello all, first of all : a big THANK YOU for your work.

I write today to exit from three days stunned posture trying to use Python pdf2image import and code in a code block.

Here is my config :

The error is : in my transform pdf into image part of my workflows, the "code block" (python setup) return Problem in node ‘Code2‘ ModuleNotFoundError: No module named 'pdf2image' and I cannot pass this damned error.

Capture d’écran 2024-08-16 à 11 30 30

Hope you can help me to understand if the problem comes from my docker compose setup or command, my privileges on my mount container or something that I don't expect.

Bests Regards

traderpedroso commented 3 weeks ago

Hello all, first of all : a big THANK YOU for your work.

I write today to exit from three days stunned posture trying to use Python pdf2image import and code in a code block.

Here is my config :

  • docker-compose.yml with requirements.txt mounted
  • sudo docker compose up -> the whoami function in the container show that I'm root inside it
  • my "N8N - Trigger install Python" workflow with "instance started" and a "Execute comand : pip install -r requirements.txt" stdout respond Defaulting to user installation because normal site-packages is not writeable\n [...] Requirement already satisfied: pdf2image in /home/node/.local/lib/python3.10/site-packages (from -r requirements.txt (line 7)) (1.17.0)
  • the "Execute command" block with "pip install pdf2image" stdout respond Defaulting to user installation because normal site-packages is not writeable\nRequirement already satisfied: pdf2image in /home/node/.local/lib/python3.10/site-packages (1.17.0)\nRequirement already satisfied: pillow in /home/node/.local/lib/python3.10/site-packages (from pdf2image) (10.4.0)

The error is : in my transform pdf into image part of my workflows, the "code block" (python setup) return Problem in node ‘Code2‘ ModuleNotFoundError: No module named 'pdf2image' and I cannot pass this damned error.

Capture d’écran 2024-08-16 à 11 30 30

Hope you can help me to understand if the problem comes from my docker compose setup or command, my privileges on my mount container or something that I don't expect.

Captura de Tela 2024-08-23 às 22 47 07

Bests Regards

You can't import using code block! this node are not the code block search for python Function