Most iPython \"magic functions\" work fine for me right off the bat: %hist
, %time
, %prun
, etc. However, I noticed that
You have two ways to make work %lprun
, one solution is temporal, i.e., it lasts until you finish your ipython
session, and the other one is permanent.
Temporal: (as Carlos Cordoba's answer)
After starting ipython
run the following:
In [1]: %load_ext line_profiler
Permanent:
Add the following lines to ~/.ipython/profile_default/ipython_config.py
:
c.TerminalIPythonApp.extensions = [
'line_profiler',
]
If you don't have the file ~/.ipython/profile_default/ipython_config.py
, you can create it by (see this for more info):
ipython profile create