I am needing to integrate Python scripts into my UIPath processes. I have discovered that i will need to use the activities from the “UIPath.Python” library, but I do not know what i need to download from Packages in order to enable this.
I already have Python 3.8.2 installed in its Default directory, and use VSCode to successfully create Python scripts. When i try to download the generic Python or Python (32-bit) packages, they install with errors:
Unfortunately that is not the case. All Packages is selected, and searching for Python nor UIPath.Python.Activities returns that package for download. Screenshots below are the full list of results returned when searching for “Python”.
Yes i was able to add them and now i can add the activities.
I’m having an issue actually running anything though. In another forum post, a user linked a simple Python execution workflow (attached) and i am attempting to run it but keep getting “Error loading Python Script. InvalidOperationException”.Python_Mini_Demo.zip (2.5 KB)
The ReadMe says that i need Python 3.6+ located in “C:\Python36”. The default install directory for Python is actually “C:\Users\username\AppData\Local\Programs\Python” So i just copied that into “C:\Python36”. I’m not sure that’s accurate though.
An ExceptionDetail, likely created by IncludeExceptionDetailInFaults=true, whose value is:
System.InvalidOperationException: Error loading Python script ----> System.ServiceModel.FaultException`1[System.ServiceModel.ExceptionDetail]: Exception has been thrown by the target of an invocation.
Server stack trace:
at System.ServiceModel.Channels.ServiceChannel.ThrowIfFaultUnderstood(Message reply, MessageFault fault, String action, MessageVersion version, FaultConverter faultConverter)
at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object ins, Object outs, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at UiPath.Python.Service.IPythonService.LoadScript(String code)
at UiPath.Python.Impl.OutOfProcessEngine.<>c__DisplayClass11_0.b__0()
at System.Threading.Tasks.Task`1.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.LoadScript.d__12.MoveNext()
— End of inner ExceptionDetail stack trace —
at UiPath.Python.Activities.LoadScript.d__12.MoveNext()
— End of stack trace from previous location where exception was thrown —
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 have tried numerous configurations there, yes. I have 3.8.2 installed, and i have the path pointing to the same directory C:\Users\mibiss\AppData\Local\Programs\Python\Python38-32. I have tried selecting x86 and x64, and have tried Auto for Version as well as Python_36.
I either get the same error i already pasted here, or i get “Could not detect Python version” if i selected “Auto”.
That was it. I thought i read somewhere that you just needed 3.6 or greater. I installed 3.6.8, pointed UIPath towards that version and it runs fine now.