Reply
New Contributor
Posts: 2
Registered: ‎03-20-2019

Arguments in CDSW Experiments not passed properly

I am trying to run sklearn models via CDSW Experiments. My python code should be accepting arguments using sys.argv[1] snippet. However, when I run the script via CDSW Experiments and put arguments in the UI, it seems like there are no arguments being read by the script.

 

This is what's in sys.argv 

print(sys.argv)
['/var/lib/cdsw/python3-engine-deps/bin/ipython3']

 

Error

inParam = sys.argv[1]
IndexError: list index out of range
Cloudera Employee
Posts: 41
Registered: ‎04-28-2017

Re: Arguments in CDSW Experiments not passed properly

Are you putting arguments in the arguments field of the UI or after your script name?  I don't see an immediate issue with what you're trying to do.

Highlighted
New Contributor
Posts: 2
Registered: ‎03-20-2019

Re: Arguments in CDSW Experiments not passed properly

I am putting the arguments in the "Arguments" field in the "Run Experiment" UI