System.InvalidOperationException while loading Python Script

Hi !
I am getting a System.InvalidOperationException while trying to load a very simple Python script.

I’ve installed Python 3.6 32 bit inside my project folder, so the python executable is at Python/python.exe path from the root folder.
I don’t have any issue running or importing my script from the Powershell command line. I reproduced the error even with an extremely basic script: I’ve attached an example of a workflow and a python script (as a zip file) that throw the error.

Here is the error from the logs:

Exception Type: System.InvalidOperationException

An ExceptionDetail, likely created by IncludeExceptionDetailInFaults=true, whose value is:
System.InvalidOperationException: Error loading Python script ----> System.ServiceModel.FaultException`1[System.ServiceModel.ExceptionDetail]: Une exception a été levée par la cible d’un appel.

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()

It would be amazing if someone could help me.
Thank you !

test.zip (217 Bytes)
testPython.xaml (5.7 KB)

PS: I have answered another topic with the exact same error as mine here : Load Python Script Error, but it does not seem to be visited anymore, therefore I’m opening this new topic.

Hi @Claire_RPA

Could you try this solution:

Or at least giving the absolute path to the folder in which the .exe file is? (Please note how the .exe file is not part of the actual path, I saw this being an issue for others in the past)

2 Likes

Hi @loginerror !

Thank you very much for your answer, putting in the absolute path to the folder of the .exe file indeed solves the problem entirely !

2 Likes

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