How to pass variables as parameters in the "invoke python method" in UIPath

How to pass variables as parameters in the “invoke python method” in UiPath
I used a For Each file in Folder loop, I am getting each file. How do i pass this file as a input parameterto the “invoke python method” in Python activities in UiPath.


Welcome to the community

This is how you do it



Is there something wrong with my python scope , I put a message box inside “Do” but still it doesnt get printed.
I feel my python scope is the issue

@Anil_G I am using python version 3.10


Your path should be the python.exe file path…please correct it


@Anil_G I am getting an error when i use python.exe’s path.

Can you show me the folder at which python is installed?
By default it will be something like this:

Use library path as: “C:\Users<USERNAME>\AppData\Local\Programs\Python\Python310\python310.dll”

Use path as: “C:\Users<USERNAME>\AppData\Local\Programs\Python\Python310\python.exe”


Looks like the path is wrong…

Please check this step by step guide


  1. Library path → This should be the path to the .dll file

  2. Path → This should be the path to the FOLDER containing python.exe

  3. To send parameters into a Python method from UiPath, send in an array of variables where the position of variables are the same as the position of arguments in the Python method, e.g.

def sum(arg_a, arg_b, arg_c):
     return arg_a + arg_b + arg_c
  1. Then your UiPath code would be as below. Take note to add a Load Python Script activity pointing at your .py file before using Invoke Python Method

See this guys , my scope is fine right , but still the message box inside ‘Do’ is not printing when i run , please guide me please check this

Please try installing .Net 5.0 runtime.

After installing, try re-run the bot.

Any logs generated when you run?

no logs are generated

Can you share your workflow? Also take a screenshot of the Output panel when the robot runs?