环境描述:
1
2
3
|
1.win7
x64
2.python
2.7
32
3.ipython
5.2
.
2
|
问题描述:
1
2
|
In [
9
]:
%
lprun
ERROR:root:Line magic function `
%
lprun`
not
found.
|
解决步骤:
1.安装line_profiler
下载地址:https://pypi.python.org/pypi/line_profiler/2.0
安装:python setup.py install
2.修改ipython 配置文件
1
2
3
|
C:\Users\hunk206\.ipython>ipython profile create
[ProfileCreate] Generating default config
file
: u'C:\\Users\\hunk206\\.ipython\\
profile_default\\ipython_config.py'
|
1
|
在文件ipython_config.py 中添加 c.TerminalIPythonApp.extensions
=
[
'line_profiler'
]
|
3.测试
1
2
|
In [
1
]:
%
lprun
Timer unit:
3.42177e
-
07
s
|
本文转自独弹古调 51CTO博客,原文链接:http://blog.51cto.com/hunkz/1935016,如需转载请自行联系原作者