Unable to invoke python file into UiPath process

HI ,
I am need to invoke python code into UiPath studio workflow. I am using python scope, load python script and invoke python method.

Im using correct dlls and folders.
python 3.9.8 version
But receiving error in Python scope itself.
Kindly suggest alter techniques to invoke python code.

Hey @megala.ramaswamy,

Check for Python environment configuration within UiPath, ensuring all dependencies are correctly installed and accessible to the Python Scope activity. Verify the Python version compatibility with UiPath and the specific libraries being used. If the issue persists, consider alternative methods like using the “Start Process” activity to execute Python scripts directly, or wrapping the Python code in a command-line executable that UiPath can call.

Let me know if you need anything else

Dear @megala.ramaswamy,

From your provided snip, you have AMD 64 architecture.
Please sleect correct target try & try.

Let me know if issue still persists. :slight_smile:

Br,
NikZ

Thanks you @Mir.Jasimuddin ,
Do we need to specify python.exe python anywhere in python scope activity.
can u correct which dll path i should provide
but i tried all below

Also please correct me any property field is worng.

The run is stuck in python scope activity everytime

@megala.ramaswamy,

What is the error you are getting?

Hello @ashokkarale ,

There is No errors, but the run is stuck in python scope activity.

@megala.ramaswamy

generally when the run is stuck it is the .net runtime issue

try to open event viewer from start window and check there should be some error related to .net

please install.net 6 based on the version of python pavckage you have

also python39.dll is what you need to provide

cheers

Hi @megala.ramaswamy ,

Is your Python script running in the Python compiler/terminal correctly?

Try adding duration in the timeout property of python scope(just for testing)

@megala.ramaswamy,

It’s .Net version not installed on your machine issue. Get this version installed and you should be fine.

Remember to use latest possible version of the Python package.

Ok @ashokkarale , i will install .net 6 and try

@Tapas_Kumar_Pattnaik - Is your Python script running in the Python compiler/terminal correctly? | i have provided dll and correct python path. And tried with timeout property too. No luck

@Anil_G - I will try with .net 6 once installed. And thanks for correcting dll file-python39.dll

@Nikhil_Zambare1 - I tried with x86 also, no luck

@Mir.Jasimuddin - Let me try this alternate approach also.

Thanks for sharing. i will come back

1 Like

Hey @megala.ramaswamy,

For Python Scope: Set “Path” to your Python installation folder (e.g., C:\Python39), not python.exe. “Library path” goes to its Lib folder. Ensure all Python dependencies are installed.

For first-run failures: These often stem from timing or dynamic UI elements. Implement delays before actions or set WaitForReady for UI activities. Refine selectors using UI Explorer, focusing on stable attributes rather than volatile ones, to ensure consistent element identification.

Hey! If Python Scope is throwing an error even though you’re using the right setup, it’s likely a version compatibility issue — UiPath doesn’t fully support Python 3.9. Try switching to Python 3.7, which is more stable with UiPath.

Also make sure:

  • UiPath and Python are both 64-bit or both 32-bit.
  • You’re pointing to the correct python.exe in Python Scope.
  • The environment type in Python Scope matches your setup (e.g., Python 3.x).

Alternative: Use Start Process to call the script directly:

  • Run python.exe with your script path as an argument.
  • Capture results via logs or file output.

Let me know if you need an example for that setup!

Ensure the path in Python Scope matches the actual installation of Python 3.9.8.
Example: C:\Users<User>\AppData\Local\Programs\Python\Python39\python.exe
Use Compatible Python Version

UiPath officially supports Python 3.6 to 3.9. You’re using 3.9.8, which should work, but try 3.8.x if issues persist.
Run Studio as Administrator

Sometimes permission issues block Python integration. Try launching UiPath Studio as Administrator.
Install Required Packages

Ensure all Python packages used in your script are installed and accessible via the same Python environment.
Check for 32-bit vs 64-bit Conflicts

UiPath Studio is typically 64-bit. Make sure your Python installation matches (64-bit).

Dear @megala.ramaswamy,

1. Check if you have .NET installed:
In CMD, type dotnet --list-sdks
It will list out framework you have installed as below:
image

2. Get python path:
To know exact path of python open CMD and write below “where python”

You will get the path something as above. Remove .exe from path & pass it to Path argument in the activity.

C:\Program Files\Python313

Here 313 is python 3.13.3 version.

3. Library Path Argument: Path which incluse Python.dll file.It is location in same folder. In my case it is as follows:

C:\Program Files\Python313\python313.dll

4. Target: To find target open CMD & type python. You will get below output:

So, your installed python has x64 target type.

5. Python version: From step number 4, you will get the version.

Hope this helps you to configure python scope.

Please let me know if you have any doubts. Else mark as solution :slight_smile:

Final Result:

Br,
NikZ

Hello @Nikhil_Zambare1,

i have provided all correct information to python scope activity.

please find below screen,

Below Start process activity is running, but i dont see any error or output file

Dear @megala.ramaswamy,
Please provide me Python Scope Argument snap to understand better.

The initial snap you have shared has wrong Library path & Python path. Attaching your provided earlier snap for reference.

Please configure Python Scope Argument as directed by me & check.

Br,
NikZ

To use a Python script in UiPath, you need to use the UiPath.Python.Activities package. This allows you to invoke Python scripts and use their functions within UiPath workflows.

For installation

  1. Install the Required Package

2.Open UiPath Studio

3.Go to Manage Packages (Ctrl+P)

4.Search for UiPath.Python.Activities

5.Click Install and then Save

To use that.

1.use Load Python Scope

2.Load python script for i.e load and function which would add two number.

3.Invoke python method and pass the parameter or agument to add two number and save result in variable.

4.Get python object to get result in varibale

If its not working below pointer need to check.

Check Python Version Compatibility

Ensure Script Has a Return Value

Python Script Errors Silently Failing run Python Manually First.

If still no response: Try a minimal script like:

Check python version.

def hello():

return “Hello from Python”

Hi @Nikhil_Zambare1 ,

please find below snip after corection and tried

But seems like .Net frameowrk issue.

Above image start process worked and generated output after i changed py file path from “c/onedrive-alliance/xyz.py” into “c/local/temp/xyz.py” because strings comes after - char taking as argument, hence received terminal error like “c/onedrive” not exist.

Start process i can use. However i need work with python scope after installation of .NET 6

Hi @Aleem_Khan ,

i have tried these steps. Thank you

1 Like

Hi @megala.ramaswamy

As of now you can try to use start process activity where in file : you can provide the file path of the python script where it should be in .py and then try to run this script as well
Please open cmd where you can provide the path and check script is running or not if any errors please share the screenshot for the same.
Happy automation!

1 Like