rkern / line_profiler

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

How to use kernprof on module? #134

Open yabb85 opened 5 years ago

yabb85 commented 5 years ago

Hi,

I try to analyze my module but when i launch kernprof, I have the following error: ValueError: Attempted relative import in non-package I try several method to launch kernprof:

Normally i use the following command to launch my script: python -m mymodule.__main__

Thank you very much

ttbrunner commented 5 years ago

Here's a workaround: https://github.com/rkern/line_profiler/issues/8 You can change the pythonpath and then it should work.