Python Script not working - from PIL import Image

I am trying to load python script within python application scope, but it’s showing error like:

Message: Pipe is Broken

Exception Type: System.IO.IO.Exception

Can any one help me out with this error.

Hi @Akash_Khobare ,

There are many Topics similar to the Error that you are facing, Have you Checked them ? Below is one such post :

Let us know if this doesn’t work

1 Like

Thanks for your response. But my query is not working correctly as per your shared documentation. Can you do me a favor on how to handle Pipe is broken error in Uipath.

@Akash_Khobare ,

Could you show us your Workflow Screenshots? We would want to look at the Python Scope Activity Properties.

1 Like

Hey buddy, Everything is working fine with addition and subtraction in python. I am able to link python (python scope), invoke python method, get python object and print out the results in message box. But when it comes to complex programming like processing images, the first line itself in my itself is giving an error like Pipe is Broken. The thing is import PIL is not effective while running in UiPath, but when I run it on IDE, it works perfectly for me. So come out with the solution for this line of code: “from PIL import Image”

Hello @Akash_Khobare

So it working now after using “from PIL import Image”. As per my understanding the import of library should work as how you are doing in IDE.

1 Like

@Akash_Khobare ,

As it already works in case of simple imports, maybe it is due to the reason that the module needs to be installed first. Take a look at the below post where I install the specific module and execute it. You don’t need to concentrate on other parts, just the installation of the module, in your case the module PIL

1 Like

The specific module has been installed already and is working in IDE. But not in Uipath.

Same error I am getting: Pipe is Broken.

I also tried giving the library path in the properties section. Still not good to go.

It is not working as the same as in IDE. I am using Pycharm and it executes the code successfully.

The code is “from PIL import Image”

When ran on UiPath, it throws an error.

@Akash_Khobare ,

I did perform a Test with the import statement, and it did work without throwing out any errors.

I’ll just upload the Screenshots for you to analyse the differences if any.

1 Like

@Akash_Khobare Can you check whether from Pycharm and from Uipath you are targeting same python… Also try to update Uipath python package aswell

1 Like

Thank you guys, the issue has been resolved. ‘sitepakages’ was installed by Pychram was replaced into the Python library in C folder. It worked perfectly well. Also note that Pillow-8.4.0.dist-info was installed for working with python in Uipath which supports only 32-bit presently. Happy automation!

1 Like