Check the Python exe file path location is properly specified in Python Scope properties
Check the installed Python version is 64-bit or 32-bit. In case of 32-bit version select x86
Specify the Python version installed. It is always better to specify the Python version rather selecting Auto.
Step-B:
Instead of using " Run Python Script " activity, use Load Python Script → Invoke Python Method → Get Python Object .
Remove the Print statements in Python Code
Step-C:
If there is any error related to dependency/Package not found, please check if for the specified python instance (Configured in Python Scope) that package is installed. You can check the package is already installed by executing the command “pip install ” . If it is already installed, it should prompt as “Requirement already satisfied” as below.
If you have any python distribution installed in system like Anaconda, it installs packages in its directory only. Check python file you are trying to run from UiPath can be run from the command prompt for the specified installation. If any dependency is missing. install the dependency first.
Step-D:
In most of the cases executing python code from UiPath doesn’t give the proper error,
As Python is an interprited language, every statement is executed separately. Use following code snippet to identify which line is causing the issue:
outF =open("myOutFile.txt", "w")
outF.write("Test line1 added")
outF.close()
Step-E: (Work around)
If using Python activity, you are still getting error though the file can be run successfully from Command Prompt or Python IDLE. Run the python file from Powershell as below:
My python script not execute when i run in UiPath.Python.Activities version 1.1.6863.33404.
But when i run version 1.0.7346.28183, it run well because in this version have WorkingFolder and i can fill it.
My question, how i can run my python script in version 1.1.6863.33404
RemoteException wrapping System.AggregateException: One or more errors occurred. —> RemoteException wrapping System.InvalidOperationException: Error loading Python script —> RemoteException wrapping System.ServiceModel.FaultException`1[[System.ServiceModel.ExceptionDetail, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]: ImportError : No module named skimage
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__DisplayClass13_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 exception stack trace —
at UiPath.Python.Activities.LoadScript.d__12.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)
can someone help me with this error, i have scikit-image package already installed in my system and python script is properly running using cmd also.
Hi @roopali_jain ,
as he said in his first post, if UiPath still doesn’t manages to find the module (And your code runs properly elsewhere), then make it run through powershell comand or start process.
I prefer the later. How to do it?
create your script myscript.py
create a batch file runmyscript.bat
in UiPath, use the activity Start Process with the path towards your .bat
I would like to add that if you’re using distribution Anaconda, you may face issues with importing some library packages when doing a load script activity.
Solution:
From anaconda3\Library\bin copy below files and paste them in anaconda3/DLLs: