# How to execute Python script?

**URL:** <https://forum.uipath.com/t/how-to-execute-python-script/45584>\
**Category:** Help\
**Tags:** python, activities\
**Created:** [July 3, 2018, 8:24am UTC](https://forum.uipath.com/t/how-to-execute-python-script/45584 "2018-07-03T08:24:10Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![suda\_amir](https://avatars.discourse-cdn.com/v4/letter/s/a5b964/32.png) [@suda\_amir](https://forum.uipath.com/u/suda_amir)\
**Post date:** [July 3, 2018, 8:24am UTC](https://forum.uipath.com/t/how-to-execute-python-script/45584/1 "2018-07-03T08:24:10Z")

</div>

Can anyone share a demo file on how to execute a python script from UiPath?

---

<div class="post-metadata">

**Author:** ![ovi](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/ovi/32/21072_2.png) [@ovi](https://forum.uipath.com/u/ovi)\
**Post date:** [July 3, 2018, 2:28pm UTC](https://forum.uipath.com/t/how-to-execute-python-script/45584/2 "2018-07-03T14:28:17Z")

</div>

Check the example here:

> [@How to use the Python Activity in the studio beta](https://forum.uipath.com/t/how-to-use-the-python-activity-in-the-studio-beta/30580/8):
>
> @yegushang what is the issue you encountered? See if this example of @cornel helps: [Python\_Mini\_Demo.zip](https://global.discourse-cdn.com/uipath/original/3X/8/1/8146e79b12787cf29cb6cda8e42f355388d9f645.zip) (2.5 KB)

---

<div class="post-metadata">

**Author:** ![suda\_amir](https://avatars.discourse-cdn.com/v4/letter/s/a5b964/32.png) [@suda\_amir](https://forum.uipath.com/u/suda_amir)\
**Post date:** [July 4, 2018, 6:38am UTC](https://forum.uipath.com/t/how-to-execute-python-script/45584/3 "2018-07-04T06:38:57Z")

</div>

Thanks a lot. I was using python 3.7 64-bit. Maybe that was the reason it wasn’t working

---

<div class="post-metadata">

**Author:** ![ovi](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/ovi/32/21072_2.png) [@ovi](https://forum.uipath.com/u/ovi)\
**Post date:** [July 6, 2018, 3:30pm UTC](https://forum.uipath.com/t/how-to-execute-python-script/45584/4 "2018-07-06T15:30:04Z")

</div>

Yes, for now only the 32-bit one works.

---

<div class="post-metadata">

**Author:** ![somya177](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/somya177/32/64130_2.png) [@somya177](https://forum.uipath.com/u/somya177)\
**Post date:** [September 25, 2018, 6:26am UTC](https://forum.uipath.com/t/how-to-execute-python-script/45584/5 "2018-09-25T06:26:10Z")

</div>

hi @ovi

I am trying to run the code but I am getting this error.  
Please help.

 ![error](https://global.discourse-cdn.com/uipath/original/3X/4/3/43e6b850beac83869fccb00b4453a1a2978dce2b.png)

---

<div class="post-metadata">

**Author:** ![ig250097](https://avatars.discourse-cdn.com/v4/letter/i/a4c791/32.png) [@ig250097](https://forum.uipath.com/u/ig250097)\
**Post date:** [November 10, 2018, 6:59am UTC](https://forum.uipath.com/t/how-to-execute-python-script/45584/6 "2018-11-10T06:59:06Z")

</div>

hi,  
Have you mentioned the version also in properties of this python scope activity , if you are working with python 36 then give version as Python 36.  
If this also does not work then try to give path of Python35 in python scope activity and give version also Python\_35 in properties of this activity.  
Your problem will be resolved.

---

<div class="post-metadata">

**Author:** ![somya177](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/somya177/32/64130_2.png) [@somya177](https://forum.uipath.com/u/somya177)\
**Post date:** [November 15, 2018, 5:20am UTC](https://forum.uipath.com/t/how-to-execute-python-script/45584/7 "2018-11-15T05:20:00Z")

</div>

Can you please share any XAML where you have integrated python with UiPath?  
A basic will also work.

Regards,  
Som

---

<div class="post-metadata">

**Author:** ![Rishi1](https://avatars.discourse-cdn.com/v4/letter/r/e9c0ed/32.png) [@Rishi1](https://forum.uipath.com/u/Rishi1)\
**Post date:** [November 15, 2018, 5:39am UTC](https://forum.uipath.com/t/how-to-execute-python-script/45584/8 "2018-11-15T05:39:19Z")

</div>

Hi @somya177  
[Flowchart.xaml](https://global.discourse-cdn.com/uipath/original/3X/0/b/0bbf5708efe76b0a1fb46c01035c0c9677dd3693.xaml) (10.7 KB)

> **[pdftoe.py](https://jumpshare.com/v/fYwOyrUSXMhn9OVyaBWw)**
>
> Shared with Jumpshare

please find attached workflow and the script file which i am running , i am passing the parameters to the script and getting the output in uipath

---

<div class="post-metadata">

**Author:** ![somya177](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/somya177/32/64130_2.png) [@somya177](https://forum.uipath.com/u/somya177)\
**Post date:** [November 15, 2018, 11:00am UTC](https://forum.uipath.com/t/how-to-execute-python-script/45584/9 "2018-11-15T11:00:38Z")

</div>

Hi,

I am unable to execute it.It’s throwing error:

 ![Screenshot%20(258)](https://global.discourse-cdn.com/uipath/original/3X/a/1/a1da8a45ad8698a1cc572577738b7274e6a8b0d8.png)

Please let me know the changes to be done.

R’ds,  
Som

---

<div class="post-metadata">

**Author:** ![Rishi1](https://avatars.discourse-cdn.com/v4/letter/r/e9c0ed/32.png) [@Rishi1](https://forum.uipath.com/u/Rishi1)\
**Post date:** [November 16, 2018, 5:43am UTC](https://forum.uipath.com/t/how-to-execute-python-script/45584/10 "2018-11-16T05:43:45Z")

</div>

Hi @somya177

[Flowchart.xaml](https://global.discourse-cdn.com/uipath/original/3X/4/d/4dc2491a9aeef7238e776dc3cc9f6c9269a673b9.xaml) (10.8 KB)

> **[pdftoe.py](https://jumpshare.com/v/fYwOyrUSXMhn9OVyaBWw)**
>
> Shared with Jumpshare

now i have given the small script , copy paste the script file to some folder and then in the workflow change the pythonScriptPath according to your script path.  
so whatever string you pass in the attachName you will get the length of that string in the output.

---

<div class="post-metadata">

**Author:** ![vedantnarayan](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/vedantnarayan/32/127335_2.png) [@vedantnarayan](https://forum.uipath.com/u/vedantnarayan)\
**Post date:** [December 17, 2018, 1:18pm UTC](https://forum.uipath.com/t/how-to-execute-python-script/45584/11 "2018-12-17T13:18:29Z")

</div>

Hi @somya177 and @Rishi1,

I am new to UiPath. I was trying to execute a simple python script and run into the same error as shown above in this thread. I am attaching the xaml file . Please help.

 ![uipatherror](https://global.discourse-cdn.com/uipath/original/3X/d/5/d57aa13ee5b187d8c80fe05991d38305c8a6c02a.png) [pythontest.xaml](https://global.discourse-cdn.com/uipath/original/3X/b/0/b0afb3170541265c9d58f341032200c6a45fec62.xaml) (7.0 KB)

---

<div class="post-metadata">

**Author:** ![Rishi1](https://avatars.discourse-cdn.com/v4/letter/r/e9c0ed/32.png) [@Rishi1](https://forum.uipath.com/u/Rishi1)\
**Post date:** [December 20, 2018, 6:08am UTC](https://forum.uipath.com/t/how-to-execute-python-script/45584/12 "2018-12-20T06:08:41Z")

</div>

Hi @vedantnarayan  
is your python exe path correct?

---

<div class="post-metadata">

**Author:** ![vedantnarayan](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/vedantnarayan/32/127335_2.png) [@vedantnarayan](https://forum.uipath.com/u/vedantnarayan)\
**Post date:** [December 25, 2018, 3:53am UTC](https://forum.uipath.com/t/how-to-execute-python-script/45584/13 "2018-12-25T03:53:37Z")

</div>

@Rishi1 Yes. Please refer this screenshot.

 ![image](https://global.discourse-cdn.com/uipath/original/3X/9/b/9bccde13e13082d955b49ab5eaca83576c750f1f.png)

---

<div class="post-metadata">

**Author:** ![Rishi1](https://avatars.discourse-cdn.com/v4/letter/r/e9c0ed/32.png) [@Rishi1](https://forum.uipath.com/u/Rishi1)\
**Post date:** [December 26, 2018, 9:13am UTC](https://forum.uipath.com/t/how-to-execute-python-script/45584/14 "2018-12-26T09:13:56Z")

</div>

Hi @vedantnarayan  
give this much path “C:\Python35”
