Skip to main content

Hi Everyone,

I am trying to Import .py file and Execute function using A360 it is throwing BOT error but same python code is perfectly working fine in pycharm editor, Any suggestions will be highly appreciated

 

 

Hi @bhargavi.B ,

 

Try with below code.

********************************

import pandas as pd

def CompareExcel():
    
    df1 = pd.read_csv('Input_Dump - Copy1.csv', encoding='cp1252')
    df2 = pd.read_csv('Input_Dump - Copy2.csv', encoding='cp1252')

    # Perform comparison
    result = df1 ~df1.apply(tuple).isin(df2.apply(tuple))]

    # Export result to 'Output.csv'
    result.to_csv('Output.csv', index=False)

    return result

# Call the function
output_data = CompareExcel()
print(output_data)  # Optional: Print the result for verification

 

************************************
 


Hi @DK 964 ,

Thanks for your Investigation,

As suggested, I tried below Python Snippet but still same BOT error when i am trying to execute same code snippet in PyCharm it is perfectly working fine snapshots as below, Thanks in advance….

 


Hello. It’s because you don’t have pandas saved in the correct directory. When you create a py script in pycharm it downloads all dependencies locally to that project. In order to have AA run your pyscript all dependencies have to be saved globally. I think you can open cmd and run a line like “pip install pandas” on your user level and you should be good to go. Should be stored in this location I think c:\program files\python38\lib\site-packages. Hopefully this helps!


Yes, you are absolutely right. In Automation Anywhere, when you are trying to run a Python script that relies on external libraries like Pandas you need to ensure those libraries are installed globally, not just locally to the PyCharm project or virtual environment.

By installing the dependencies globally, the Automation Anywhere bot will be able to find the required libraries.


Thnx


Reply