i attached a printscreen of error message displayed in UIPath Studio.
I also attached a printscreen of the file folder containing the python executable
In this post, Palaniyappan provided a sample UIPath process “PythonActivitiesTest” which loads a simple python script. I had successfully run this sample UIPath process using my environment in "C:\Users\edang\anaconda3\envs\mldds3”…
Hi the simple test.py script works for my python enviromment.
The ‘text-summarizer.py’ script works independently without using UIPath. This script is actually from this here: Understand Text Summarization
So i think it is well tested to work
So i guess the issue is related around loading of Python Script in UIPath Studio…
Hi Gustavo,
Haha I faced the same error from UIPath Studio when I try to load the updated ‘test.py’
FYI I can run text-summarizer.py successfully using my python environment (without UIPath Studio use), so my python environment have the required python libraries
So, your error is related to Python project dependences in UiPath Studio. Because if you run test.py using your Python environment it works. Also, if you delete import rows, test.py works in UiPath Studio too.
Let’s say this python project’s dependencies aren’t visible to your UiPath project.
Instead of copying your .py file from Python project and pasting it in your UiPathStudio, try to indicate .py original path. I mean, it’s located inside your Python project path. Example: C:/Users/Gustavo/PycharmProjects/TestProject/test.py
This can work because in that directory the environment is set and has everything you need to run.
With the right python environment containing necessary dependencies loaded in Pycharm, i was able to execute ‘test.py’ in this folder
I reduce the number of ‘imports’ in ‘test.py’ to just a single import to use a popular/widely used Numpy library. UIPath can’t load this simplified script…
The problem is related to incorrect setup of the Python environment.
Make sure the Python version used has all the required packages installed, the working folder is set to the folder that keeps all the resources that are used in the Python script using relative paths - to the working folder - and the script is referenced to the full path of the script in Load script.
A test that verifies that everything is set up right is to run the script from windows command prompt as “python.exe script.py” where script.py is the script used in the project.