ipython 运行 %lprun 报错

环境描述: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
相关文章
相关标签/搜索