Python Pyodide in n8n

Hello,
I’m using the code node to build with python an IMAP connection to retrieve a list of folders from an email server.
My problem is that I need to use from the python IMAPLIB module: IMAP4_SSL and IMAP4.authenticate(), but in pyodide is stated that SSL is unvendored by default (Pyodide Python compatibility — Version 0.28.2 Documentation link). Is there any way I can activate this on n8n so I can use the python module fully?
Thanks for the help!

Unfortunately the only way for now is using a custom node like this one, to perform the IMAP related actions and then pass whatever data you need to the code node:

Thx for the answer!

Sorry for asking another question, but I was reading the docs and I just saw that Pyodide was declared Legacy? Code node documentation | n8n Docs I may have skipped this or something.

For what I see this is the main one now: Code node documentation | n8n Docs (Im trying to figure out what each of these points mean)
For example: “Native Python supports importing native Python modules from the standard library and from third-parties,”

IMAPLIB should work now no?

Basically:I saw that its possible to install third party dependencies and import built-in modules , Now this doesnt seem to block the SSL module (like pyodide did) but all of thats in the documentation its related to the runners its related to docker

Ah, nice catch, I completely forgot about the beta native python support! Yes, with this you should be able to bake in any dependencies into the task-runners image as explained in the docs, so yes, this should be OK for your use case :slight_smile:

It’s strange because Im trying to apply the code and Im getting this:

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.