title: ipykernel_launcher.py: error: the following arguments are required:
body: <p>I want to run a python script, say <code>train_rnn_wdcnn_loads.py</code> in jupyter notebook from Anaconda in Win 10.
  But I constantly get this error:</p>
  <pre><code>ipykernel_launcher.py: error: the following arguments are required: -data_path
  </code></pre>
  <p><em>(I'm new in Python and still figuring out how argparse works)</em></p>
  <p>The code are:</p>
  <pre><code>import argparse
  parser = argparse.ArgumentParser(fromfile_prefix_chars='@')
  parser.add_argument('-data_path', required=True)
  args = parser.parse_args()
  </code></pre>
  <p>I have tried to make it works with:</p>
  <pre><code>parser.add_argument('-data_path', required=True, default=&quot;C:\\Users\\Firdaus\\Desktop\\data&quot;)
  </code></pre>
  <p>or from <a href="https://stackoverflow.com/a/51172247/8129852">this answer</a>:</p>
  <pre><code>args = parser.parse_args(data_path=&quot;C:\\Users\\Firdaus\\Desktop\\data&quot;)
  </code></pre>
  <p>and it still didn't work.</p>
  <p>When I run the script via command line, <code>python train_rnn_wdcnn_loads.py -data_path C:\\Users\\Firdaus\\Desktop\\data</code> it works but still facing error in another python script.</p>
  <pre><code>Using TensorFlow backend.
  1614364082.0161884
  loading data ...
  Traceback (most recent call last):
    File &quot;train_rnn_wdcnn_loads.py&quot;, line 107, in &lt;module&gt;
      source_data = CWRUBearingData(data_path, experiment, source,
    File &quot;C:\Users\Firdaus\AppData\Local\Programs\Python\Python38\lib\site-packages\utils\cwru_data_loader.py&quot;, line 114, in __init__
      for l in self.loads:
  TypeError: 'NoneType' object is not iterable
  </code></pre>
  <p>How to run the script without error?</p>