I am trying to use Python Activities but I have issues with invoking my Python Methods.
What’s unusual is that it was able to successfully invoke my methods a day before, but today it started giving me this error after adding another method to the script.
I am using Python 3.9.19, UiPath.Python.Activities 1.6.0, and I even dowloaded the .NET Desktop Runtime 5.0.17 x64 thing that many people advised.
Both the script and python.exe are in the same directory. I used Anaconda to setup all the dependencies. I was able to successfully run the script from cmd using their absolute paths. I also added the path of the python.exe and any other necessary paths to PATH. The activities in UiPath seem to be configured properly. After looking through several posts, I cannot seem to find a solution.
I know Studio has a few workarounds, but Start Process and Powershell Prompt activities don’t seem to be available in StudioX. Anyone have any ideas on what I should do?
Just to confirm - does it continue to work if you run it without that extra method?
If yes, does it run with just the faulty method?
If yes, can the method be simplified to the state that makes it work?
Also, the latest Python activities package version supports .NET 6, so if you want to try that, you will have to install the desktop runtime for .NET 6 as well.
It doesn’t work regardless of which method I run. I had it working yesterday, so I didn’t run it before I added the new method.
The new method isn’t faulty because I can successfully run the script from cmd.
I even did simple methods like add and a method that just returns a value, but I couldn’t invoke those either. I will try downloading the .NET 6 and update the python activities and try again.
Edit: Even after downloading .NET 6 and updating the python activity package, I am getting the “Error invoking Python method”. The only difference is that 1.8.1 is actually working now, whereas it would just stall before. Do you recommend I use a later version of Python as well?
Or is an issue with how I input my parameters. Here’s how I did it:
New List (Of String) From {pathString}
New List(Of String) From {extractedText, modelPath}
Edit2.0: I found Invoke Powershell and Invoke Process. I will try using that instead.
You could still try this sample project, which was recently updated to cover Python 3.12, but should in theory also work with minimum changes for your Python version:
I’ve tried something in StudioX, and was able to throw the same error by providing the method name in double quotes, while it should be treated as text with not quotes…