line_profiler: what am I doing wrong?

Neal Becker ndbecker2 at gmail.com
Mon Feb 16 14:42:43 EST 2015


Robert Kern wrote:

> On 2015-02-13 13:35, Neal Becker wrote:
>> Robert Kern wrote:
>>
>>> @profile
>>> def run():
>>> pass
>>>
>>> run()
>>
>> No, this doesn't work either.  Same failure
>>
>> kernprof -l test_prof.py
>> Wrote profile results to test_prof.py.lprof
>> Traceback (most recent call last):
>>    File "/home/nbecker/.local/bin/kernprof", line 9, in <module>
>>      load_entry_point('line-profiler==1.0', 'console_scripts', 'kernprof')()
>>    File "/home/nbecker/.local/lib/python2.7/site-packages/kernprof.py", line
>>    221,
>> in main
>>      execfile(script_file, ns, ns)
>>    File "test_prof.py", line 1, in <module>
>>      @profile
>> NameError: name 'profile' is not defined
> 
> Ah, do you have the package `future` installed?
> 
> https://github.com/rkern/line_profiler/issues/12
> 

Yes, I do.  What do you suggest as a workaround?

-- 
-- Those who don't understand recursion are doomed to repeat it




More information about the Python-list mailing list