Question

python script with import statements causing error in a360

  • 15 June 2022
  • 1 reply
  • 38 views

I'm trying to run a python script on a360, it has few import statements for api requests and csv import and that's causing an error while executing.

what should I do?


1 reply

have you manually installed the imported libraries ?

 

if not please try to install them using pip install REQUIREDLIB

 

It should work after that.

 

for reference if you want execute below script

 

import datetime

 

def test(arg):

  f = open("C:\\Users\\someUser\\Desktop\\test.txt", "w")

  f.write(str(datetime.datetime.now()))

  f.close()

  return arg

 

you can use Execute function, pass a variable and get it back ( very stupid of me 🙂 )

 

Some error scenario,

  1. if you don't install datatime lib manually using cmd, you may get Bot Error.(though it work in some IDE like Pycharm without any issue)
  2. if you install datetime lib but do no include import statement in python code, you may get Bot Error.

 

Hope this would help, if not please let me know, i can try to help.

Reply