title: Read/Mount a csv file inside train.py of Azure ML Pipeline
body: <p>We are collecting data from Eventhub and AppInsight and storing it in azure blob. By using AzureML pipeline I want to pass my dataset into train.py going through two different logics(one for ml, another for fraud analysis).</p>
  
  <p>But I couldnt read the csv file for further processing from inside the <code>train.py</code> </p>
  
  <p>This is my <code>train.py</code> which is running through <code>PythonScriptStep</code> in Azure Machine Learning Pipeline</p>
  
  <pre><code>import argparse
  import os
  import pandas as pd
  
  print("In train.py")
  
  parser = argparse.ArgumentParser("train")
  
  parser.add_argument("--input_data", type=str, help="input data")
  parser.add_argument("--output_train", type=str, help="output_train directory")
  
  args = parser.parse_args()
  
  print("Argument 1: %s" % args.input_data)
  df = pd.read_csv(args.input_data)
  print(df.head())
  
  print("Argument 2: %s" % args.output_train)
  
  if not (args.output_train is None):
      os.makedirs(args.output_train, exist_ok=True)
      print("%s created" % args.output_train)
  </code></pre>
  
  <p>And this is the code for running the Pipeline</p>
  
  <pre><code>ws = Workspace.from_config()
  def_blob_store = Datastore(ws, "basic_data_store")
  aml_compute_target = "test-cluster"
  try:
      aml_compute = AmlCompute(ws, aml_compute_target)
      print("found existing compute target.")
  except ComputeTargetException:
      print("Error")
  
  source_directory = './train'
  
  blob_input_data = DataReference(
      datastore=def_blob_store,
      data_reference_name="device_data",
      path_on_datastore="_fraud_data/test.csv")
  trainStep = PythonScriptStep(
      script_name="train.py", 
      arguments=["--input_data", blob_input_data, "--output_train", processed_data1],
      inputs=[blob_input_data],
      outputs=[processed_data1],
      compute_target=aml_compute, 
      source_directory=source_directory,
      runconfig=run_config
  )
  pipeline1 = Pipeline(workspace=ws, steps=[compareStep])
  pipeline_run1 = Experiment(ws, 'Data_dependency').submit(pipeline1)
  </code></pre>
  
  <p>Down below in the output trace, you can see the output <code>Argument 1</code> is printing the path of the file</p>
  
  <p><code>Argument 1: /mnt/batch/tasks/shared/LS_root/jobs/pipeline-shohoz/azureml/d92be2ab-e63f-4883-a14b-a64fa5bb431d/mounts/basic_data_store/_fraud_data/test.csv</code></p>
  
  <p>So I have successfully pass the dataset but cant read the file inside train.py on line <code>pd.read_csv(args.input_data)</code>.  It is showing </p>
  
  <p><code>FileNotFoundError: [Errno 2] File b'/mnt/batch/tasks/shared/LS_root/jobs/pipeline-shohoz/azureml/d92be2ab-e63f-4883-a14b-a64fa5bb431d/mounts/basic_data_store/_fraud_data/test.csv'</code> </p>
  
  <p>this is the full trace from <code>70_driver_log.txt</code> which I have downloaded from azureml log,</p>
  
  <pre><code>Preparing to call script [ train.py ] with arguments: ['--input_data', '/mnt/batch/tasks/shared/LS_root/jobs/pipeline-shohoz/azureml/d92be2ab-e63f-4883-a14b-a64fa5bb431d/mounts/basic_data_store/_fraud_data/test.csv', '--output_train', '/mnt/batch/tasks/shared/LS_root/jobs/pipeline-shohoz/azureml/d92be2ab-e63f-4883-a14b-a64fa5bb431d/mounts/basic_data_store/azureml/d92be2ab-e63f-4883-a14b-a64fa5bb431d/processed_data1']
  After variable expansion, calling script [ train.py ] with arguments: ['--input_data', '/mnt/batch/tasks/shared/LS_root/jobs/pipeline-shohoz/azureml/d92be2ab-e63f-4883-a14b-a64fa5bb431d/mounts/basic_data_store/_fraud_data/test.csv', '--output_train', '/mnt/batch/tasks/shared/LS_root/jobs/pipeline-shohoz/azureml/d92be2ab-e63f-4883-a14b-a64fa5bb431d/mounts/basic_data_store/azureml/d92be2ab-e63f-4883-a14b-a64fa5bb431d/processed_data1']
  
  In train.py
  Argument 1: /mnt/batch/tasks/shared/LS_root/jobs/pipeline-shohoz/azureml/d92be2ab-e63f-4883-a14b-a64fa5bb431d/mounts/basic_data_store/_fraud_data/test.csv
  
  
  The experiment failed. Finalizing run...
  Cleaning up all outstanding Run operations, waiting 300.0 seconds
  1 items cleaning up...
  Cleanup took 0.001172780990600586 seconds
  Starting the daemon thread to refresh tokens in background for process with pid = 136
  Traceback (most recent call last):
    File "train.py", line 18, in &lt;module&gt;
      df = pd.read_csv(args.input_data) #str()
    File "/azureml-envs/azureml_eb042e80b9a6abdb5821a78683153a38/lib/python3.6/site-packages/pandas/io/parsers.py", line 685, in parser_f
      return _read(filepath_or_buffer, kwds)
    File "/azureml-envs/azureml_eb042e80b9a6abdb5821a78683153a38/lib/python3.6/site-packages/pandas/io/parsers.py", line 457, in _read
      parser = TextFileReader(fp_or_buf, **kwds)
    File "/azureml-envs/azureml_eb042e80b9a6abdb5821a78683153a38/lib/python3.6/site-packages/pandas/io/parsers.py", line 895, in __init__
      self._make_engine(self.engine)
    File "/azureml-envs/azureml_eb042e80b9a6abdb5821a78683153a38/lib/python3.6/site-packages/pandas/io/parsers.py", line 1135, in _make_engine
      self._engine = CParserWrapper(self.f, **self.options)
    File "/azureml-envs/azureml_eb042e80b9a6abdb5821a78683153a38/lib/python3.6/site-packages/pandas/io/parsers.py", line 1917, in __init__
      self._reader = parsers.TextReader(src, **kwds)
    File "pandas/_libs/parsers.pyx", line 382, in pandas._libs.parsers.TextReader.__cinit__
    File "pandas/_libs/parsers.pyx", line 689, in pandas._libs.parsers.TextReader._setup_parser_source
  FileNotFoundError: [Errno 2] File b'/mnt/batch/tasks/shared/LS_root/jobs/pipeline-shohoz/azureml/d92be2ab-e63f-4883-a14b-a64fa5bb431d/mounts/basic_data_store/_fraud_data/test.csv' does not exist: b'/mnt/batch/tasks/shared/LS_root/jobs/pipeline-shohoz/azureml/d92be2ab-e63f-4883-a14b-a64fa5bb431d/mounts/basic_data_store/_fraud_data/test.csv'
  </code></pre>
  
  <p>I have tried the relative path </p>
  
  <p><code>azureml/8d2b7bee-6cc5-4c8c-a685-1300a240de8f/mounts/basic_data_store/_fraud_data/test.csv</code> </p>
  
  <p>and also the Uri </p>
  
  <p><code>wasbs://shohoz-container@shohozds.blob.core.windows.net/azureml/azureml/8d2b7bee-6cc5-4c8c-a685-1300a240de8f/mounts/basic_data_store/_fraud_data/test.csv</code></p>
  
  <p>but ending with the same <code>FileNotFoundError</code> result. I am banging my head on the wall for last 3-4 days. Any help will save my brain.  </p>