rkern / line_profiler

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

NameError: name 'profile' is not defined - INSTALLED FROM MASTER #95

Closed jackalack closed 7 years ago

jackalack commented 7 years ago

From previous posts, I see the solution to this problem is to clone and install from master, however, I did that and still see this error. I see this error when I run kernprof -l script.py

rkern commented 7 years ago

We'll need more information in order to help you. What platform are you on? Python version? The contents of the script.py, at least. Did you remove old versions of the kernprof.py script?

jackalack commented 7 years ago

Ah, I didnt realize that you need to call kernprof -l from within the folder that the script lives in. Once I did that it worked fine

rkern commented 7 years ago

Or rather, you need to provide the full (relative) path to the script being profiled (unless if it's sitting on the $PATH). You don't need to be in the same folder as it.