Import in Python 3.12.4 is not working - Pipe is broken

Hi guys, I have faced an issue when I have import statements in my python script UiPath gives error: Pipe is broken. I have read all the forum regarding this question but nothing helps me. Script I am trying to run:
image

  • I have tried script without imports and it works
    image

  • Json is set upped to my PC

  • Environment variables are added to the System variables
    image

  • I have tried adding import to the function but still fails

  • I am using sequence:
    Python scope
    Load Python Script
    Invoke Python Method
    Get Python Object

Do you have any thoughts?

1 Like

Can you try this approach?

I tried with:

Python 3.12.4 installed at C:\Program Files\Python312
Studio 23.10.7
UiPath.Python.Activities.1.8.1
UiPath.System.Activities.23.10.6

Python code:

import sys
import os
sys.path.append(os.path.dirname(os.path.realpath('C:\\Program Files\\Python312')))


def simple_function():
	import json
	result = {"message": "Test"}
	json_output = json.dumps(result)
	return json_output




A similar approach was discussed here Integrating Python script for Encrypt and Decrypt

Thank you so much, it is working!! :heart:

2 Likes

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.