I found the following article: Timing and Profiling in IPython from March, 2013, but I am having problems defining and using the magics. I wonder if this is because some of the information in the article does not apply anymore.
I did:
$ pip install line-profiler
$ pip install psutil
$ pip install memory_profiler
and then in my IPython session I defined:
import memory_profiler
def load_ipython_extension(ip):
ip.define_magic('memit', memory_profiler.magic_memit)
ip.define_magic('mprun', memory_profiler.magic_mprun)
When when I then try:
%memit
I get: ERROR: Line magic function not defined
. Why?
Also, is the article from 2013 relevant still for IPython 2.x?