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.

Is there any update on this? We are understandably getting pushback on installing .net6 just to get one activity to work

1 Like

Hi @g.ward

We are having trouble reproducing the issue, but it is clearly still present.

Could you maybe share your exact version of Windows? I tried reproducing it by matching your environment details without success.

Thanks for the quick response - this happens on several machines so I can get a few examples, but the one this particular machine is on:

Edition Windows 10 Pro
Version 22H2
Installed on ‎25/‎12/‎2022
OS build 19045.5608
Experience Windows Feature Experience Pack 1000.19061.1000.0

Theres also a windows 11 machine with the same issue, I’ll add that when I get a chance.

Just to validate, would you mind trying out this version of the Python package to see if it fixes your issue?

We’re trying to guess work here a bit, and such validation would speed up our development.

You will be able to download it from here:
https://uipath-my.sharepoint.com/:u:/p/maciej_kuzmicz/EfuyoGOdepNMof8sEqJevYAB8mEAsiMo0IJzU_I-pSM1XA

Happy to try although I cannot access that page with my UiPath registered email, also raised a ticket on this and sent examples over including diagnostic information you may be aware of.

I have normally set this file above to be available to anyone. Please let me know in case it doesn’t let you download the package.