AttributeError: 'str' object has no attribute 'show' I am trying to pass any test json file as part of the command line argument. When doing so it treats it as a string , which I dont want but I want it to be treated as a DataFrame so it can show the dataframe with df.show(). I get this error message on the terminal saying AttributeError: 'str' object has no attribute 'show’. df = sqlContext.read.json(“tester.json") def show_data(df): df.show() parser = argparse.ArgumentParser() parser.add_argument(‘-I’, ‘—inputfile', required=True , default =df) args = parser.parse_args() show_data(args.parameterfile) Continue reading...