Use pip to install this package:
pip install line_profiler
It is easier to install using conda, since it does not require building the package from source:
# if you use pip on Windows, you must have Visual Studio to build the package. conda install line_profiler
How to profile?
Annotate the function we want to profile with
@profile annotation. On the
command line, run:
kernprof -v -l test_script.py
The command line options to
test_script.py can be followed after it. Just
like you call
- How can I profile Python code line-by-line?
License CC BY-NC-ND 4.0