環境描述:python
1.win7 x64 2.python 2.7 32 3.ipython 5.2.2
問題描述:ide
In [9]: %lprun ERROR:root:Line magic function `%lprun` not found.
解決步驟:測試
1.安裝line_profilerspa
下載地址:https://pypi.python.org/pypi/line_profiler/2.0
ip
安裝:python setup.py installget
2.修改ipython 配置文件it
C:\Users\hunk206\.ipython>ipython profile create [ProfileCreate] Generating default config file: u'C:\\Users\\hunk206\\.ipython\\ profile_default\\ipython_config.py'
在文件ipython_config.py 中添加 c.TerminalIPythonApp.extensions = ['line_profiler']
3.測試io
In [1]: %lprun Timer unit: 3.42177e-07 s