Python Activity Troubleshooting

Step-A: (Validate the Configuration parameters)

  1. Check the Python exe file path location is properly specified in Python Scope properties
  2. Check the installed Python version is 64-bit or 32-bit. In case of 32-bit version select x86
  3. Specify the Python version installed. It is always better to specify the Python version rather selecting Auto.

Step-B:

  1. Instead of using " Run Python Script " activity, use Load Python Script -> Invoke Python Method -> Get Python Object .
  2. Remove the Print statements in Python Code

Step-C:

  1. If there is any error related to dependency/Package not found, please check if for the specified python instance (Configured in Python Scope) that package is installed. You can check the package is already installed by executing the command "pip install " . If it is already installed, it should prompt as “Requirement already satisfied” as below.
  2. If you have any python distribution installed in system like Anaconda, it installs packages in its directory only. Check python file you are trying to run from UiPath can be run from the command prompt for the specified installation. If any dependency is missing. install the dependency first.

Step-D:
In most of the cases executing python code from UiPath doesn’t give the proper error,
As Python is an interprited language, every statement is executed separately. Use following code snippet to identify which line is causing the issue:

outF = open ( "myOutFile.txt" , "w" )

outF.write("Test line1 added")

outF.close()

Step-E: (Work around)
If using Python activity, you are still getting error though the file can be run successfully from Command Prompt or Python IDLE. Run the python file from Powershell as below:

10 Likes

Thank you so much for your post!

1 Like

Great post, very useful :+1:

My python script not execute when i run in UiPath.Python.Activities version 1.1.6863.33404.
But when i run version 1.0.7346.28183, it run well because in this version have WorkingFolder and i can fill it.

My question, how i can run my python script in version 1.1.6863.33404