When trying to run a python script from UiPath using Python Scope, UiPath just stops and hangs there indefinitely, no error message or anything, just gets stuck there forever. I tried using version 1.6 and version 1.4.1 to no avail. Please provide a working solution to this problem.
Hi @swilson
If the UiPath Python Scope activity is hanging or failing without any error message, it could be caused by a variety of issues. Here are some potential causes and ways to troubleshoot:
- Syntax errors in the Python code: Make sure that the Python code inside the Python Scope activity is free of syntax errors. You can use a Python linter or run the code in a Python interpreter to check for syntax errors.
- Incorrect Python version: Make sure that the Python version specified in the Python Scope activity matches the version of Python installed on your system.
- Incorrect library paths: If you are using external libraries in your Python code, make sure that the library paths are correct and that the libraries are installed on your system.
- Dependency issues: If you are using third-party libraries in your Python code, make sure that all the required dependencies are installed.
- Permission issues: Make sure that the UiPath service has the necessary permissions to execute the Python code.
To debug the issue, you can try the following steps:
- Enable the “Capture Output” option in the Python Scope activity and check the output for any error messages.
- Add a Try-Catch block in the Python code to catch any exceptions and print the error messages.
- Add a log message before and after the Python code to see where the execution is hanging.
- Use a Breakpoint activity before the Python Scope activity and debug the issue step by step.
Hello @swilson
Please confirm whether you have tested the python script in an IDE? Also please check the below video for getting more clarification.
Thanks
Hi, did you find a solution?
I have the same issue.
The other replies here do not address the issue of the Python Scope being stuck, it’s not possible to debug further or get an error message.
Hi @GibPad
Could you please sure this is installed?
Mainly:
For Windows projects, the Python Scope activity requires you to install the .NET Desktop Runtime 5.0.17.