Looking Assistance for Python

Hi @Jesmine,

Maybe we can understand the problem clearer by trying out different Python examples.

For Example, we can test with other modules instead of camelot and get to a conclusion whether if it’s a problem with a Specific module or the Configuration of the Python Scope that is being used.

You can test it with Other Samples of Python Code. The reason I am suggesting this is because I too got the Same error "Pipe Broken" when I used xlsxwriter module.

To Solve this issue, I had to first install the module 'xlsxwriter'. To do it I followed the below Steps:

  1. Opened Up my Command Prompt.
  2. Copied Full Path of Python Scripts folder C:\Users\[Username]\AppData\Local\Programs\Python\Python37-32\Scripts
  3. Used the below Command to change the Directory to the Scripts Folder.
    cd C:\Users\[Username]\AppData\Local\Programs\Python\Python37-32\Scripts
  4. Next, used the command to install xlsxwriter as below using pip
    pip install xlsxwriter

After this I had provided the Folder Path of the Script as the WorkingFolder Property value.
Then I was able to use the Below Python Code in UiPath, which will create an xlsx file.

def call_function_uipath():
    import xlsxwriter
     
    # Workbook() takes one, non-optional, argument
    # which is the filename that we want to create.
    workbook = xlsxwriter.Workbook('hello.xlsx')
     
    # The workbook object is then used to add new
    # worksheet via the add_worksheet() method.
    worksheet = workbook.add_worksheet()
     
    # Use the worksheet object to write
    # data via the write() method.
    worksheet.write('A1', 'Hello..')
    worksheet.write('B1', 'Geeks')
    worksheet.write('C1', 'For')
    worksheet.write('D1', 'Geeks')
     
    # Finally, close the Excel file
    # via the close() method.
    workbook.close()

The UiPath Workflow Looks Like below :
image

Path Property Value :
image

WorkingFolder Property Value : The Folder where the Python Script is Placed.
image

Property of Load Python Script Activity:
image

Property of Invoke Python Method :
image

Do let us know if it works out or if you have got the Solution already, Please Do post the Solution.

1 Like