I am trying to load this python file via a python scope but UiPath crashes with a ‘Pipe is Broken’ error.
Link to pickled model: pickled_model.sav - Google Drive
Python Script:
import pickle
import numpy as np
def predict_label(x_test):
filename = 'D:\\My POCs\\UiPath - Pickled Model\\pickled_model_2.pkl'
loaded_model = pickle.load(open(filename, 'rb'))
file1 = open("D:\\My POCs\\UiPath - Pickled Model\\Model_pickling\\myfile.txt","w")
file1.write(x_test)
file1.write('\n')
file1.close()
I know I have chosen the right activities because this script works when I comment out the pickle.load command.
Thanks
loginerror
(Maciej Kuźmicz)
September 2, 2021, 5:50pm
2
Hi @Rohaan_Nadeem2
I am not sure if that will solve your issue, but maybe you could have a look at this simple post:
A bit of extra info here.
The Python activities are invoked regardless of context, using only the Windows environment variables. If, for some reason, a certain path is not set or if a certain Python package is only available in a certain environment (e.g. in the Miniconda console you used to install a certain version of Python), then the script execution will fail.
As a simple verification, you should be able to run the script using nothing but the Windows Command Prompt.
<path to python.exe> …
1 Like
Hey @loginerror
This was the a brilliant suggestion. I ran the script on CMD and realized the base environment was missing 1 library. Once I installed it, the program has been running flawlessly.
Thanks!!
1 Like