Hello All,
Can you please help me how to run Python script in UiPath, as i used Python activity but unable to perform operation.
Regards,
Pankaj
1 Like
well
Use python Scope and change the path
use load script and pass your script path and get output like OutScript
use Invoke Python Method and give input parameters and call your function and pass your script instance
and use get python Object!
cheers!
@Pankajsapkal07
1 Like
Please go through the following link :
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):
return(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…
1 Like
Here you go with an example
Please check this sample workflow (it assumes that Python 3.6 is installed at “C:\Python36”): PythonActivitiesTest.zip (2.5 KB)
After loading the script with the Load Python Script activity, you can call a method in a script using Invoke Python Method’s input property called Input parameters.
Invoke Python Method returns a PythonObject that can be passed to the the Get Python Object activity for conversion into a .NET object.
Cheers @Pankajsapkal07
1 Like
Hi Palaniyappan,
Thanks for sharing the sample workflow. I updated the filepath to where my python 3.6.4 is installed… but it cannot work - “Error initializing python engine”. Please kindly advise if my python version of 64 bit cannot work in UiPath 2019.4.4?
Is there a way to work around it? Thank you!
1 Like
Kindly Have a view on this discussion
hey @pratosha.hegde
Just use this path and better to set Auto in version selection.
C:\Users\hegdepra\AppData\Local\Programs\Python\Python35\
one thing - The Above path is not look good. Python installed on your system?
if it is show it should be like C:\Python36_64 or if you will have installed with Visual Studio then path will be like
"C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64"
but if your python.exe is there exists that use that path how i mentioned above.
Let…
Cheers @eagerlearner
system
(system)
Closed
April 27, 2020, 8:07am
8
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.