rkern / line_profiler

(OLD REPO) Line-by-line profiling for Python - Current repo ->
https://github.com/pyutils/line_profiler
Other
3.61k stars 255 forks source link

%lprun will break as of IPython 5.0 #61

Closed anntzer closed 8 years ago

anntzer commented 8 years ago

define_magic has apparently been deprecated for a while and is now removed: https://github.com/ipython/ipython/pull/9504/files Starting IPython with the line_profiler extension will fail with

Traceback (most recent call last):
  File "/usr/lib/python3.5/site-packages/IPython/core/shellapp.py", line 246, in init_extensions
    self.shell.extension_manager.load_extension(ext)
  File "/usr/lib/python3.5/site-packages/IPython/core/extensions.py", line 85, in load_extension
    if self._call_load_ipython_extension(mod):
  File "/usr/lib/python3.5/site-packages/IPython/core/extensions.py", line 132, in _call_load_ipython_extension
    mod.load_ipython_extension(self.shell)
  File "/usr/lib/python3.5/site-packages/line_profiler.py", line 372, in load_ipython_extension
    ip.define_magic('lprun', magic_lprun)
AttributeError: 'TerminalInteractiveShell' object has no attribute 'define_magic'
caethan commented 8 years ago

I have a pull request in to fix this: https://github.com/rkern/line_profiler/pull/65

Please try it out and see if it works with your system.

anntzer commented 8 years ago

duplicate of #62, and I moved on to using another profiler in the meantime... thanks though.

cancan101 commented 8 years ago

@anntzer What profiler are you using now?

anntzer commented 8 years ago

https://github.com/vpelletier/pprofile Output in the callgrind format is a killer feature imo...