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

line_profiler runtime issues in default install #94

Closed ek-nath closed 5 years ago

ek-nath commented 7 years ago

conda install -c anaconda line_profiler=2.0 works but conda install line_profiler's installation succeeds. However, neither the console version nor the jupyter version work. But "Don't work", I mean, I get the following output: Could not extract a code object for the object None

python version: 3.6 windows 10 x64

GiorgioBalestrieri commented 6 years ago

Same issue here, using Jupyter with Python 3.6

fahall commented 6 years ago

I had the same issue when I used:

%lprun -f function_to_profile()

Fixed by running: %lprun -f function_to_profile function_to_profile()

Maybe try that?

Unfortunately, in Python3.6 w/ Jupyter, I am not getting any output from this.

justinmoon commented 6 years ago

@fahall That worked for me

caethan commented 5 years ago

This is a user error. The format is

%lprun -f FUNCTION_TO_PROFILE CODE_EXPRESSION_TO_RUN

In most cases the function to profile and the expression to run will be very similar, but not in all cases. Both are still required.