Hello UiPath Team,
I was working on a python script, it keeps telling me that the path is incorrect. Even after lowering the activity version.
PFA screenshot.
Hello UiPath Team,
I was working on a python script, it keeps telling me that the path is incorrect. Even after lowering the activity version.
PFA screenshot.
You are using start process also and python scope. You dont have to use start process, python scope does it for you.
for method : can you try to test it locally first
C:\Python39\python.exe C:\xxx\detect_all_traits.py
I have just added start process as an alternative, please skip start process.
I didnt understand try locally. Could you please explain?
C:\Python39\python.exe)This should fix the “path incorrect” issue.
Can you show the error you are getting? Most probably it could be issue of misconfiguring the Python Scope activity.
Refer this How to guide sample on how to configure and use the python activities.
Use only Python Scope remove Start Process ensure the Python file contains a function, set the correct python.exe path and WorkingFolder, then call the function using Invoke Python Method.
Thanks & Happy Automations
Hi @nishiijain2000 @MohammedShabbir @ashokkarale ,
I tried to add invoke python name to the method it doesnt reflect. As suggested I tried it locally. I have already disabled “Start Process”. Tested locally and got the output as well.
The problem is the path is not identified issue “Python Scope: The specified Python path is not valid: C:\Python39\python.exe”
C:\Users\BhushanVitthalNagaon>C:\Python39\python.exe “C:\Bhushan\detect_all_traits.py”
Script loaded successfully
I see Python path is the issue @BHUSHAN_NAGAONKAR1
Pass only this part as path - C:\Python39
Ok, thanks will take a look
It worked @ashokkarale , now i am facing issue with invoke method my value is “extract_all_values” showing red. It is giving a new issue to the Python scope “Python Scope: Error initializing Python engine”
Glad to hear that. Regarding the new issue, it’s happening due to the Library path. Update it to correct path of the python dll and this should work.
It will be required for Python > 3.9
Im using 3.9 version. if needed what would be the path? would it be same?
Not working could please share values for each property field. IS it due to version 3.9, or any other issue?
Use this code as reference.
https://docexamples.uipath.com/examples/Activities/Python%20v3.12%20-%20Invoking%20a%20script.zip
Thanks for the code, I have my code in same manner, it is still giving me engine issue.
26.0.182-cloud.21895+Branch.release-s182.Sha.a13df80d2b59a230f75f9a3da59183d0d94f3298.a13df80d2b59a230f75f9a3da59183d0d94f3298
Source: Python Scope
Message: Error initializing Python engine
Exception Type: System.InvalidOperationException
in Main.xaml
at PythonScope “Python Scope”
at Sequence “Body”
at ForEach`1 “For Each currentItem”
at Sequence “Main Sequence”
at Main “Main”
System.InvalidOperationException: Error initializing Python engine
—> System.Exception: Host process has exited!
output:
error: A fatal error occurred. The required library hostfxr.dll could not be found.
If this is a self-contained application, that library should exist in [C:\Users\BhushanVitthalNagaon.nuget\packages\UiPath.python.activities\1.10.0\bin\net6.0-windows7.0].
If this is a framework-dependent application, install the runtime in the global location [C:\Program Files\dotnet] or use the DOTNET_ROOT environment variable to specify the runtime location or register the runtime location in [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x64\InstallLocation].
The .NET runtime can be found at:
at UiPath.Shared.Service.Client.HostWrapper.ThrowIfProcessHasExited()
at UiPath.Shared.Service.Client.Controller1.<StartHostService>g__ServiceReady|21_0() at UiPath.Shared.Service.Client.Controller1.Retry(Func1 checkFunction, TimeSpan timeout, TimeSpan retryInterval) at UiPath.Shared.Service.Client.Controller1.StartHostService()
at UiPath.Shared.Service.Client.Controller1.Create() at UiPath.Python.Impl.OutOfProcessEngine.Initialize(String workingFolder, CancellationToken ct, Double timeout) at UiPath.Python.Activities.PythonScope.ExecuteAsync(NativeActivityContext context, CancellationToken cancellationToken) --- End of inner exception stack trace --- at UiPath.Core.Activities.ForEachBase1.OnExecutionFaulted(NativeActivityFaultContext faultContext, Exception propagatedException, ActivityInstance propagatedFrom)
at System.Activities.Runtime.FaultCallbackWrapper.FaultWorkItem.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)
Is this the issue “Requirement: .NET 6 Desktop Runtime (Windows x64)”
If .Net runtime issue, it could have given different error but give it a try - download and install and restart the machine
Also make sure you are using latest Python package - v1.10.0