Run Python Script Activity: Error running Python script


We getting an error below to running python script in UiPath.

We kindly ask for your help.

UiPath Python Package : 1.7.1
Python Version: 3.6

RemoteException wrapping System.AggregateException: One or more errors occurred. —> RemoteException wrapping System.InvalidOperationException: Error running Python script —> RemoteException wrapping 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.Dispose(Boolean disposing)
at System.IO.TextWriter.Dispose()
at UiPath.Python.Service.PythonProxy.RequestAsync(PythonRequest request,
CancellationToken ct)
at UiPath.Python.Service.PythonProxy.Execute(String code)
at UiPath.Python.Impl.OutOfProcessEngine.<>c__DisplayClass16_0.b__0()
at System.Threading.Tasks.Task.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at UiPath.Python.Activities.RunScript.d__8.MoveNext()
— End of inner exception stack trace —
at UiPath.Python.Activities.RunScript.d__8.MoveNext()
— End of inner exception stack trace —
at UiPath.Shared.Activities.AsyncTaskCodeActivity.EndExecute(AsyncCodeActivityContext context,
IAsyncResult result)
at System.Activities.AsyncCodeActivity.System.Activities.IAsyncCodeActivity.FinishExecution(AsyncCodeActivityContext context,
IAsyncResult result)
at System.Activities.AsyncCodeActivity.CompleteAsyncCodeActivityData.CompleteAsyncCodeActivityWorkItem.Execute(ActivityExecutor executor,
BookmarkManager bookmarkManager)

Hi @cyahsi ,

Make these two changes:

  1. Remove the Library path property value.

  2. In the WorkingFolder property insert the folder path where your UiPath project resides. Something like:




Just to confirm when you run and get the error try to open the event viewer logs and check the application logs…if it says .net version incompatible or so…if so then you need to install or update the .net runtime


Below are some checks that you can confirm:

1.Make sure you have installed all the library that you are using in your code using Pip install command.
2.Make sure you are passing same no. of arguments if your python code/function expecting any inputs to be passed.
3.Make sure you have installed python interpreter and passing the correct environmental path to python scope.
4.If your python code is taking time (lets say it takes bit of time for I/O operation), try to increase the timeout property in UiPath.