title: Jupyter: Line magic function not found
body: <p>I've got a persistent error:</p>
  
  <pre><code>%%writefile csvmagic.py
  import pandas as pd
  from io import StringIO
  
  def csv(line, cell):
      sio = StringIO(cell)
      return pd.read_csv(sio)
  
  def load_ipython_extension(ipython):
      """This function is called when the extension is
      loaded. It accepts an IPython InteractiveShell
      instance. We can register the magic with the
      `register_magic_function` method of the shell
      instance."""
      ipython.register_magic_function(csv, 'cell')
  
  Overwriting csvmagic.py
  
  
  
  %reload_ext csvmagic
  %%csv
  col1,col2,col3
  0,1,2
  3,4,5
  7,8,9
  
  UsageError: Line magic function `%%csv` not found.
  </code></pre>
  
  <p>"<em>Line</em> magic" does not look quite right to me, but I can't figure it out.</p>
  
  <p>The source is <a href="https://ipython-books.github.io/14-creating-an-ipython-extension-with-custom-magic-commands/" rel="nofollow noreferrer">here</a></p>