Running Python scrpit in a Workflow


I’m trying to create a workflow to run python script with the Webhook trigger.
But when I tested it, it keeps returning error, saying something like there is no such module.
For example, (from tkinter import N) doesn’t work, and neither (from docx import Document) .

Could you tell me what I need to do?
If you want, I can show you the sample script too.

Hi @chothazinthekyaw

First off, welcome to the Pipedream community. Happy to have you!

It’s possible you’re running into the mismatching package to module name problem:

You can search our custom mappings for those problem packages, as well as request new ones so we can support them.

Let me know if that helps you!

Thank you for your response.

I already checked the custom mappings before the question but I couldn’t find the modules in there.
The script I’m using has to import a lot of modules, for example,

from importlib.resources import path
from tkinter import N, W
from docx import Document
from docx.shared import Inches
from googletrans import Translator
import requests
import json
import datetime
from datetime import datetime as dt
from docx.shared import RGBColor
from docx.enum.text import WD_COLOR_INDEX
import sys

Something like above and it is just a part of script.
If I have to request, can I make all the requests?
At this time, I still haven’t checked which module works or which doesn’t throughout the whole script, because I’m also having problemes with connecting to my target API from here.

Hi @chothazinthekyaw

Thanks for the context, you might be running into a few separate issues.

1. Mismatching module to package names

For example: from docx import Document, please check out dedicated custom mappings for these types of packages:

If they are not present, we’ll happily add them for you! There’s a submission form right in that page, this triggers a workflow which will start the custom mapping process.

2. Periods . in package names

Unfortunately, we cannot support packages with period characters in their package names. You can follow the issue here for updates:

I hope this helps!