How to run pyhton script in uipath


Can you try running the file in the actual environment instead of running in virtual environment?

That is one of the issues I faced earlier and run the code in Load Python Script activity which will let you know where the code is failing?

Is version would be a problem? because i have downloaded python 3.7 but uipath have version upto 3.6

How to assign python object variable in load python script

Nothing you need to assign, just use the path in python scope and within that, use Load Python Activity and give the path

getting error in loading script , is version will be the problem?

May be… What is the error? Can you post the screenshot please?


The thing is that, I’m getting the same when I run the code you uploaded, open and check the details so you can found some error there regarding pytesseract.

when i run that script am getting output, but while running through uipath am not getting anything.

Yeah @DivyaT,

That is known thing with UiPath :blush: … As we have discussed, it may be a version issue as well. Python 3.7 is compatible with uipath is still a question for me? If you have any chance, try installing 3.6 version and check. Caution: Don’t use Virtual environments in UiPath

ok thank you

After install 3.6 also am getting repeated errors, can anyone please give solution am facing difficulty in this.

Hi @DivyaT

Just to clarify - is your Python exe file in this location?

This path should be the path to the folder with the python exe file.

1 Like

yes this is my python execution path,Actually am using pycharm interprete with python v3.6.7

Hi Divya,

Can you share your python file?

New (2.3 KB)

this is my script and Uipath activity.
Thank you.

Hi Divya,

I have gone through the code and script.

You cannot directly run a python script through UiPath. It isn’t a reliable approach or a stable approach to follow.

Python script:
The script has to be in form of a function.
Example : def(a,b):
I have transformed your script into a function. It requires two inputs.
Inp PDF file and Op Excel file.
Pass them in the UiPath program and it’ll run.
Also, make sure you have the necessary libraries installed.

Inside Python Scope,

First Load the python script. It creates an Instance
Pass the first instance to Invoke Python Method Activity. Give the necessary Input and Output.
It will call that particular method and perform the task.
In a Py function, you return something. So, the Get python Object activity fetches the Output of the function.

Attaching the zip file, Please go through it. (3.0 KB)


@Rahul_Pasupuleti Thanks for kind of information and provided solution.

In UiPath PDF activities are available to convert PDF to text.then why we need python script? Just curious to know is there any added advantage in this…please anyone explain

@DivyaT Maybe a Workaround(since I am using Python 3.7.1) would be using “Start Process” Activity in UiPath.

A Simple python code that I have would launch Chrome and Navigate to

I run the Python Script using “Start Process” Activity. (Optionally Parameters Can be passed as well)

Worth giving a try and let me know if it works.

Hello @Rahul_Pasupuleti,

I am trying to execute your python script, But facing endpoint issue.

Can you please check the attached screenshot. Help me on this!