# Getting error at python scope activity

**URL:** <https://forum.uipath.com/t/getting-error-at-python-scope-activity/745669>\
**Category:** Studio\
**Tags:** activities-panel, question, studio, python, activities\
**Created:** [June 5, 2024, 7:16am UTC](https://forum.uipath.com/t/getting-error-at-python-scope-activity/745669 "2024-06-05T07:16:21Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![victoryv4569](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/victoryv4569/32/491275_2.png) [@victoryv4569](https://forum.uipath.com/u/victoryv4569)\
**Post date:** [June 5, 2024, 7:16am UTC](https://forum.uipath.com/t/getting-error-at-python-scope-activity/745669/1 "2024-06-05T07:16:21Z")

</div>

Hi every one,

@siddharth @Yoichi@J0ska@ashokkarale  
getting error at python scope activity at path

![image](https://global.discourse-cdn.com/uipath/original/4X/8/4/0/840043bcb932ba6fedbfda511dea226f877b372e.png)

path = C:\Program Files (x86)\Python39\V\_3.9.8\soft\WPy64\python-3.9.8.amd64

How can I achieve this.

Thank you!!

---

<div class="post-metadata">

**Author:** ![RajKumar\_DC](https://avatars.discourse-cdn.com/v4/letter/r/b2d939/32.png) [@RajKumar\_DC](https://forum.uipath.com/u/RajKumar_DC)\
**Post date:** [June 5, 2024, 9:18am UTC](https://forum.uipath.com/t/getting-error-at-python-scope-activity/745669/2 "2024-06-05T09:18:07Z")

</div>

Hi @victoryv4569 ,

If posuble plz share your Python scope proparty and workflow.

Thanks,

---

<div class="post-metadata">

**Author:** ![victoryv4569](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/victoryv4569/32/491275_2.png) [@victoryv4569](https://forum.uipath.com/u/victoryv4569)\
**Post date:** [June 5, 2024, 9:24am UTC](https://forum.uipath.com/t/getting-error-at-python-scope-activity/745669/3 "2024-06-05T09:24:03Z")

</div>

Hi @RajKumar_DC

 ![image](https://global.discourse-cdn.com/uipath/original/4X/7/6/0/760faf2a96bb63c1517e2efefcea69e22652b0c6.png)

@RajKumar_DC  
Thank you!

---

<div class="post-metadata">

**Author:** ![Krishna\_Raj](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/krishna_raj/32/377808_2.png) [@Krishna\_Raj](https://forum.uipath.com/u/Krishna_Raj)\
**Post date:** [June 5, 2024, 9:36am UTC](https://forum.uipath.com/t/getting-error-at-python-scope-activity/745669/4 "2024-06-05T09:36:13Z")

</div>

@victoryv4569

> [@Error in the Python Scope Activity](https://forum.uipath.com/t/error-in-the-python-scope-activity/739106/4):
>
> @didac.elguet, Try running this sample code. You should have .Net runtime 6.0 installed and the Python exe path added to System variable. [Main.xaml](https://forum.uipath.com/uploads/short-url/qqyToRs0qgvMGNovh61QjCXfBL9.xaml) (8.3 KB) Thanks, Ashok slight_smile

check this thread as reference

---

<div class="post-metadata">

**Author:** ![victoryv4569](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/victoryv4569/32/491275_2.png) [@victoryv4569](https://forum.uipath.com/u/victoryv4569)\
**Post date:** [June 5, 2024, 9:49am UTC](https://forum.uipath.com/t/getting-error-at-python-scope-activity/745669/5 "2024-06-05T09:49:52Z")

</div>

Hi @Krishna_Raj@ashokkarale

For running python script in UiPath does " .Net runtime 6.0 installed" should be installed ?

I developing in office laptop ?

Please Kindly Confirm.

Thank you!!!

---

<div class="post-metadata">

**Author:** ![ashokkarale](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/ashokkarale/32/474400_2.png) [@ashokkarale](https://forum.uipath.com/u/ashokkarale)\
**Post date:** [June 5, 2024, 11:55am UTC](https://forum.uipath.com/t/getting-error-at-python-scope-activity/745669/6 "2024-06-05T11:55:26Z")

</div>

@victoryv4569.

Yes it is mandatory.

 ![image](https://global.discourse-cdn.com/uipath/original/4X/6/7/8/6781163780c2eadec6e2bf6daae76d4f98e702be.png)

> **[Activities - Python Scope](https://docs.uipath.com/activities/other/latest/developer/python-scope)**
>
> The UiPath Documentation Portal - the home of all our valuable information. Find here everything you need to guide you in your automation journey in the UiPath ecosystem, from complex installation guides to quick tutorials, to practical business...

Thanks,  
Ashok 🙂

---

<div class="post-metadata">

**Author:** ![victoryv4569](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/victoryv4569/32/491275_2.png) [@victoryv4569](https://forum.uipath.com/u/victoryv4569)\
**Post date:** [June 6, 2024, 9:58am UTC](https://forum.uipath.com/t/getting-error-at-python-scope-activity/745669/7 "2024-06-06T09:58:19Z")

</div>

Hi @ashokkarale

installed

 ![image](https://global.discourse-cdn.com/uipath/original/4X/2/1/f/21fbc5de26368094816ec1c119ce0eb01cf8947d.png)

but still, its not throwing any error but its just stocked.

 ![image](https://global.discourse-cdn.com/uipath/original/4X/2/0/2/2025e8307261e0093171a8e074c5dc381d340f17.png)

Properties are

 ![image](https://global.discourse-cdn.com/uipath/original/4X/5/f/b/5fbc63367ed22339e59deb579375868ab8941d11.png)

Please kindly guide me on this, after installation also why bot not able to run ?

Thank you!!!

---

<div class="post-metadata">

**Author:** ![ashokkarale](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/ashokkarale/32/474400_2.png) [@ashokkarale](https://forum.uipath.com/u/ashokkarale)\
**Post date:** [June 6, 2024, 10:40am UTC](https://forum.uipath.com/t/getting-error-at-python-scope-activity/745669/8 "2024-06-06T10:40:35Z")

</div>

@victoryv4569,

Is your python path added to environment variable? Check this once.

> **[How to Add Python to PATH – Real Python](https://realpython.com/add-python-to-path/#how-to-add-python-to-path-on-windows)**
>
> In this tutorial, you'll learn about how to add Python, or any other program, to your PATH environment variable. You'll be covering the procedure in Windows, macOS, and Linux and find out what PATH is and why it's important.

Try this sample code. It’s on higher version but try changing it as per your setup.  
[PythonTest.zip](https://forum.uipath.com/uploads/short-url/iS1Typ1avoBlTBriRYgebB83BCc.zip) (3.3 KB)

Thanks,  
Ashok 🙂

---

<div class="post-metadata">

**Author:** ![victoryv4569](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/victoryv4569/32/491275_2.png) [@victoryv4569](https://forum.uipath.com/u/victoryv4569)\
**Post date:** [June 7, 2024, 3:52am UTC](https://forum.uipath.com/t/getting-error-at-python-scope-activity/745669/9 "2024-06-07T03:52:52Z")

</div>

Hi @ashokkarale

while running the code getting error at “Invoke Python Method”  
Ran the same code in python its given the output, but in UiPath got an error

An Error was,

Invoke Python Method: Pipe is broken.

System.IO.IOException: Pipe is broken. at System.IO.Pipes.PipeStream.CheckWriteOperations()  
at System.IO.Pipes.PipeStream.Flush()  
at System.IO.StreamWriter.Flush(Boolean flushStream, Boolean flushEncoder)  
at System.IO.StreamWriter.set\_AutoFlush(Boolean value)  
at UiPath.Python.Service.PythonProxy.RequestAsync(PythonRequest request, CancellationToken ct)  
at UiPath.Python.Service.PythonProxy.Shutdown()  
at UiPath.Python.Impl.OutOfProcessEngine.Release()  
at UiPath.Python.Activities.PythonScope.Cleanup()  
at UiPath.Python.Activities.PythonScope.OnFaulted(NativeActivityFaultContext faultContext, Exception propagatedException, ActivityInstance propagatedFrom)  
at System.Activities.Runtime.FaultCallbackWrapper.Invoke(NativeActivityFaultContext faultContext, Exception propagatedException, ActivityInstance propagatedFrom)  
at System.Activities.Runtime.FaultCallbackWrapper.FaultWorkItem.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)

Properties are,

 ![image](https://global.discourse-cdn.com/uipath/original/4X/c/0/c/c0cd6e2168d6ce242951d55f8c64b898bfb37e59.png)

---

<div class="post-metadata">

**Author:** ![ashokkarale](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/ashokkarale/32/474400_2.png) [@ashokkarale](https://forum.uipath.com/u/ashokkarale)\
**Post date:** [June 7, 2024, 4:41am UTC](https://forum.uipath.com/t/getting-error-at-python-scope-activity/745669/10 "2024-06-07T04:41:15Z")

</div>

@victoryv4569,

I would suggest to create new thread for this so this new issue will get noticed by the experts.

Back to your issue, as per this thread it happens when your script returning big size data. The size could vary as per system config but this is the most probable reason.

> [@Invoke Python Method: Pipe is broken](https://forum.uipath.com/t/invoke-python-method-pipe-is-broken/341780/3):
>
> Hi @VC365, Pipe is broken is a very abstract error in .net and C# and with minimal root cause. I have wasted a lot of time trying to find out why this happens without a concrete answer in the forums or in stackoverflow. In my view, the amount of data being sent from one activity to another or one workflow to another throws “Pipe is broken.” error in UiPath. I suspect that your python code returns an object (json, og other object from python to .net) which is of a large size. What is large? I…

Other option you have is, if you could `working folder` of python scope to store the output in some file and read it back wherever required in your code again.

Thanks,  
Ashok 🙂

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/system/32/182466_2.png) [@system](https://forum.uipath.com/u/system)\
**Post date:** [June 10, 2024, 4:42am UTC](https://forum.uipath.com/t/getting-error-at-python-scope-activity/745669/11 "2024-06-10T04:42:02Z")

</div>

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.
