Python Scope throws an error on the latest UiPath.Python.Activities 1.9.0 and NET8

Thanks!

One strange problem I’m getting - code that ran fine with the previous python alpha package 1.9.0-alpha.5252821 refuses to run with this updated package, always giving me: Python Scope: Error initializing Python engine

All arguments are the same and downgrading back to the alpha version reliably fixes it. I have tried explicitly installing both the .net 6 and 8 frameworks, any idea what might be going wrong?

Hi,

I am also running into the same problem

I have dotnet 8.0.2 in C:\Program Files\dotnet

Hey @Matias_Tika @g.ward

Would you mind running this command in your CMD to double check and show us the output?
dotnet --list-runtimes

Hey,
Thanks for your response.

I have actually solved the issue. Looks like I didn’t have the SDK installed. I had “dotnet-hosting-8.0.6-win.exe” which is something else.
I installed the .NET 8 SDK and it works perfectly now.

Thanks again

1 Like

Hello @loginerror, do you have any idea what I could else check if I keep receiving exception ‘Python Scope: Error initializing Python engine’ with more details:

RemoteException wrapping System.InvalidOperationException: Error initializing Python engine  ---> RemoteException wrapping System.InvalidOperationException: Python deserialization exception  ---> RemoteException wrapping System.ArgumentNullException: Value cannot be null. (Parameter 's') 
   at System.ArgumentNullException.Throw(String paramName)
   at System.Text.Encoding.GetBytes(String s)
   at UiPath.Shared.Service.PythonResponse.Deserialize(String json)
	--- End of inner exception stack trace ---
   at UiPath.Shared.Service.PythonResponse.Deserialize(String json)
   at UiPath.Python.Service.PythonProxy.RequestAsync(PythonRequest request,
CancellationToken ct)
   at UiPath.Python.Service.PythonProxy.Initialize(String path,
String libraryPath,
Version version,
String workingFolder)
   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.Shared.Activities.AsyncTaskNativeImplementation.BookmarkResumptionCallback(NativeActivityContext context,
Object value)
   at UiPath.Shared.Activities.AsyncTaskNativeActivity.BookmarkResumptionCallback(NativeActivityContext context,
Bookmark bookmark,
Object value)
   at System.Activities.Runtime.BookmarkWorkItem.Execute(ActivityExecutor executor,
BookmarkManager bookmarkManager)

I am using:
Studio 24.10.1
Python activities 1.9 // Python 3.11.5 - user installation
Python Scope configured following the sample.

DotNet:
Microsoft.AspNetCore.App 8.0.13 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 8.0.13 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 8.0.13 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

.NET SDKs installed: 8.0.406 [C:\Program Files\dotnet\sdk]

Any idea what else could I check? Thanks!

1 Like

Also still getting this, similarly with:

dotnet --list-runtimes
Microsoft.AspNetCore.App 8.0.13 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 8.0.13 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 8.0.13 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

–list-sdks
8.0.406 [C:\Program Files\dotnet\sdk]

UiPath 24.10.8

eventviewer shows this at the time the initialise python engine error occurs:

and here’s a bit more on the actual error that UiPath shows:

Edit: Can still confirm that the same code on this machine does not error on the previous alpha package that runs on .net6

Thank you for all the input.

I moved the messages to a separate thread to be able to better track this situation.