title: livy throwing error in batchmode Error: Only local python files are supported: Parsed arguments
body: <p>I tried executing <strong>livy</strong> in batch mode by submiting a python file but it doesnt work, i tried 2 ways -</p>
  
  <ol>
  <li>Run the <strong>py</strong> file from local file system &amp; also</li>
  <li>run it on hdfs by copying it there ... but its not working... </li>
  </ol>
  
  <p>please help</p>
  
  <pre><code>hduser@tarun-ubuntu:/home/tarun/spark/examples/src/main/python$ curl -X POST -H "Content-Type: application/json"  tarun-ubuntu:8998/batches --data '{"file": "file:///home/tarun/spark/examples/src/main/python/pi.py", "name": "pipy", "executorCores":1, "executorMemory":"512m", "driverCores":1, "driverMemory":"512m", "queue":"default", "args":["10"]}'
  
  "requirement failed: Local path /home/tarun/spark/examples/src/main/python/pi.py cannot be added to user sessions."
  </code></pre>
  
  <p>so i moved <strong>pi.py</strong> to hdfs at livy atleast accepted the curl call:</p>
  
  <pre><code>hduser@tarun-ubuntu:/home/tarun/spark/examples/src/main/python$ curl -X POST -H "Content-Type: application/json"  tarun-ubuntu:8998/batches --data '{"file": "/pi.py", "name": "pipy", "executorCores":1, "executorMemory":"512m", "driverCores":1, "driverMemory":"512m", "queue":"default", "args":["10"]}'
  {"id":20,"state":"running","appId":null,"appInfo":{"driverLogUrl":null,"sparkUiUrl":null},"log":[]}
  </code></pre>
  
  <p>But when i checked the logs :</p>
  
  <pre><code>$ curl tarun-ubuntu:8998/batches/20/log | python -m json.tool  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                   Dload  Upload   Total   Spent    Left  Speed
  100  1415  100  1415    0     0   186k      0 --:--:-- --:--:-- --:--:--  197k
  {
      "from": 0,
      "id": 20,
      "log": [
          "Error: Only local python files are supported: Parsed arguments:",
          "  master                  local",
          "  deployMode              client",
          "  executorMemory          512m",
          "  executorCores           1",
          "  totalExecutorCores      null",
          "  propertiesFile          /home/tarun/spark/conf/spark-defaults.conf",
          "  driverMemory            512m",
          "  driverCores             1",
          "  driverExtraClassPath    null",
          "  driverExtraLibraryPath  null",
          "  driverExtraJavaOptions  null",
          "  supervise               false",
          "  queue                   default",
          "  numExecutors            null",
          "  files                   null",
          "  pyFiles                 null",
          "  archives                null",
          "  mainClass               null",
          "  primaryResource         hdfs://localhost:54310/pi.py",
          "  name                    pipy",
          "  childArgs               [10]",
          "  jars                    null",
          "  packages                null",
          "  packagesExclusions      null",
          "  repositories            null",
          "  verbose                 false",
          "",
          "Spark properties used, including those specified through",
          " --conf and those from the properties file /home/tarun/spark/conf/spark-defaults.conf:",
          "  spark.driver.memory -&gt; 512m",
          "  spark.executor.memory -&gt; 512m",
          "  spark.driver.cores -&gt; 1",
          "  spark.master -&gt; local",
          "  spark.executor.cores -&gt; 1",
          "",
          "    .primaryResource",
          "Run with --help for usage help or --verbose for debug output"
      ],
      "total": 38
  }
  
  curl tarun-ubuntu:8998/batches/20 | python -m json.tool  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                   Dload  Upload   Total   Spent    Left  Speed
  100   482  100   482    0     0   105k      0 --:--:-- --:--:-- --:--:--  117k
  {
      "appId": null,
      "appInfo": {
          "driverLogUrl": null,
          "sparkUiUrl": null
      },
      "id": 20,
      "log": [
          "Spark properties used, including those specified through",
          " --conf and those from the properties file /home/tarun/spark/conf/spark-defaults.conf:",
          "  spark.driver.memory -&gt; 512m",
          "  spark.executor.memory -&gt; 512m",
          "  spark.driver.cores -&gt; 1",
          "  spark.master -&gt; local",
          "  spark.executor.cores -&gt; 1",
          "",
          "    .primaryResource",
          "Run with --help for usage help or --verbose for debug output"
      ],
      "state": "dead"
  }
  </code></pre>