System.AggregateException: One or more errors occurred. —> System.InvalidOperationException: Error invoking Python method —> System.InvalidOperationException: Python instantiation exception
Python Invoker program exception:
module ‘1d84e8c0-65ea-440c-8a2e-c42dfececca5’ has no attribute ‘excess_calculation_wrapper’
at UiPath.Shared.Service.PythonResponse.ThrowExceptionIfNeeded()
at UiPath.Python.Service.PythonProxy.InvokeMethod(Guid instance, String method, IEnumerable1 args) at UiPath.Python.Impl.OutOfProcessEngine.<>c__DisplayClass15_0.<InvokeMethod>b__0() at System.Threading.Tasks.Task1.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.InvokeMethod.d__16.MoveNext()
— End of inner exception stack trace —
at UiPath.Python.Activities.InvokeMethod.d__16.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)
In this case, the best course of action is to simplify the script file to a minimum (a dummy hello-world type of script), with the same name.
Quick question - why do you have line breaks at the end of the script definition in the sample above? For reference, a complete working dummy script that should work for sure is just this:
i did not write this code another coworker did and they are no longer with the company. so i’m just trying to get it to work with Python 3.12 since we are on 3.6 now.
I did just see that I have Python 3.13 and 3.12 on this VM. I have asked for them to remove it and will test again.
I’m going to go to my other VM that I think only has 3.12 and will test my theory out. then i will do the simple code.
System.AggregateException: One or more errors occurred. —> System.InvalidOperationException: Error invoking Python method —> System.InvalidOperationException: Python instantiation exception
Python Invoker program exception:
dummy_func() takes 0 positional arguments but 7 were given
at UiPath.Shared.Service.PythonResponse.ThrowExceptionIfNeeded()
at UiPath.Python.Service.PythonProxy.InvokeMethod(Guid instance, String method, IEnumerable1 args) at UiPath.Python.Impl.OutOfProcessEngine.<>c__DisplayClass15_0.<InvokeMethod>b__0() at System.Threading.Tasks.Task1.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.InvokeMethod.d__16.MoveNext()
— End of inner exception stack trace —
at UiPath.Python.Activities.InvokeMethod.d__16.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)
I’ll be able to have a closer look at it tomorrow, but from a quick look, it seems like your functions are actually contained in a JSON formatted structure.
This is not how the activity ingests them, and this is mostly where the issue is.
You will have to deserialize the JSON and then provide the deserialized string of your function to the Load Python Script activity. I will suggest some more concrete approaches for that tomorrow.