Python scope not working, no error also

Looks like python scope is not working in upgraded version. Path everything is correct for Python. But I added Python package and trying to load script etc. Its not doing anything. It just shows Partially executed.

Hi, I have a similar issue, the activity do nothing and no error but I don’t see the “Partially Executed” message. I don’t know what I’m doing bad:
Path: “C:\Program Files\QGIS 3.24.1\apps\Python39”
Target: x64
Version: Python 3.9
Can anyone help us?
Thanks in advance

Hello @Ranjit_Nayak1
Provide the working folder as your script folder and try to execute the process

Thank you but it doesn’t work, it’s like the activity doesn’t find the .exe file and it waits for it because it doesn’t execute nothing after the python scope.

@mmarcos
Try this,
Open Command Prompt
type–> where python and press Enter
Copy the path and provide it as the path in Python scope

If I put exactly what “where python” returns I obtain an error. If I use the path “C:\python3” occurs the same, the program do nothing

Hi @Ranjit_Nayak1

Just to double check, could you do the simple test from the topic below?

1 Like

I have similar issue, process stuck at Python Scope and give no response.
I found RC is converting to Windows and then problems occurs, if revise back to earlier project then it is ok.


Not sure if we have same RC, but worthing trying.

I got help from UiPath support and this issue got resolved after having the python dll path updated in the library path as shown below

I was able to run python code after installing .NET 5.0.17 Desktop Runtime and by providing below settings for Python Scope Activity v1.6.0.

For Python 3.9.16:
Path: “C:\Users\USERNAME\AppData\Local\Programs\Python\Python39”
Working Folder: Working folder of the script.

For Python 3.10:
Library Path: “C:\Users\USERNAME\AppData\Local\Programs\Python\Python310\python310.dll”
Path: “C:\Users\USERNAME\AppData\Local\Programs\Python\Python310”
Working Folder: Working folder of the script.

4 Likes

Hi, I am still facing this issue. Are there any fixes to this?
Python scope is working fine with the projects made in Windows-legacy model, but the same code when copied to a latest Windows project, it’s getting stuck in python scope. No error at all!

> 
> This one works fine

Properties

Please assist, as this is kind of very annoying.

@amithvs
please install .NET Desktop Runtime 5.0.17 Download .NET 5.0 Desktop Runtime (v5.0.17) - Windows x64 Installer (microsoft.com)

5 Likes

Hi @amithvs

Would you mind giving the two workarounds/fixes mentioned above a go and reporting back if the issue persists?

Hi, I installed the .NET desktop runtime and the bot is working fine now. Thanks a lot.

Just a question:

  1. Do we need to install the same when migrated to a production VM?

Hi, the above fix seems working fine. Can we expect a permanent fix from UiPath’s side any time soon? May be a package which is compatible with the latest windows update or something.

Since it requires additional installation with admin access, a lot of process has to be carried out for approval on an organization level.

Yes, .net 5.0.17 runtime installation is required.

2 Likes

After spending quite some time in trying to solve this issue, two tips for others facing the same issue of Python Scope hanging up:

  • Note that if you search for “download .NET Desktop Runtime” you easily end up downloading .NET 7.0 SDK, which unfortunately does not include an updated Desktop Runtime. The components can be found here: https://dotnet.microsoft.com/en-us/download/dotnet/7.0
  • Also, while the hanging up problem was solved by downloading Desktop Runtime 5, my robot would still crash when loading the Python script; however, updating to Desktop Runtime 7 finally fixed the issue.

Hello Juho, I did perform all the recommended steps, but still my execution is hanging at python scope and nothing is working beyond that in the windows model. Earlier I was using python 3.11.2 but then I even tried with with python 3.10.9. Please find the merged screenshots for your reference and let me know if I am missing anything?

I came upon the Python Scope issue on another computer with another Windows Legacy project migrated to Windows, and this time updating the Desktop Runtime did not solve the issue. I will try to run the project on the computer where Python works, maybe that sheds some light into where the issue is.

Ok, now I have some more insight on the issue.

I moved my robot from one computer with Studio 2022.10.5 Enterprise to another with Studio 2023.4.0 Community Edition. The only change I did was to redirect the python code location (which I define in a separate file) to another location. (I’ve tested both computers and the python interpreter runs from the command line in that address, so it should not be an python environment or path issue.)

When opening the project on the new computer, UiPath seemed to encounter errors (log available for UiPath support on request) but offered to fix them “Automatically cleaning dependencies and imports in your workflows may fix the problem”, Having done so, the Python scope initialises without hanging up. So it seems to be that the newer version can fix the problem automatically. I took note of the output and will send a support request to UiPath.