为什么线探查器仅显示部分结果?
我的行Profiler %lprun -f
有效,但不显示行内容,而仅显示数字。因此,这对我来说是没用的。它显示一些目录问题如下。
Timer unit: 1e-07 s
Total time: 0.962042 s
Could not find file C:\Users\my name\AppData\Local\Temp\ipykernel_20788\3519952779.py
Are you sure you are running this program from the same directory
that you ran the profiler from?
Continuing without the function's contents.
Line # Hits Time Per Hit % Time Line Contents
==============================================================
1
2 1 24.0 24.0 0.0
3 6 211.0 35.2 0.0
当我运行%lprun?
时,我看到它的目录是c:\ users \我的名字\ anaconda3 \ lib \ lib \ site-packages \ line_profiler \ ipython_extension.py
这里的解决方案是什么?
我尝试但失败的事情是: 1。重新安装line_profiler与我的代码相同的目录中。 2。尝试在我的代码目录中复制ipython_extension.py,但无法找到任何appdata文件夹 3。创建我的代码的.py文件,然后重新运行程序
My line profiler %lprun -f
works but does not show the line contents but only the numbers. So it is useless for me. It shows some directory problem as below.
Timer unit: 1e-07 s
Total time: 0.962042 s
Could not find file C:\Users\my name\AppData\Local\Temp\ipykernel_20788\3519952779.py
Are you sure you are running this program from the same directory
that you ran the profiler from?
Continuing without the function's contents.
Line # Hits Time Per Hit % Time Line Contents
==============================================================
1
2 1 24.0 24.0 0.0
3 6 211.0 35.2 0.0
And when I run %lprun?
i see it's directory is c:\users\my name\anaconda3\lib\site-packages\line_profiler\ipython_extension.py
What is the solution here?
Things I tried but failed: 1. Re-installing line_profiler in the same directory as my code.
2. Trying to copy-paste the ipython_extension.py inside my code directory but couldn't locate any AppData folder
3. Create a .py file of my code and then re-run the program
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论