line_profiler was created by one of the developers of NumPy. This module does line-by-line profiling of Python code. We will describe the necessary installation steps in this recipe.
You might need to install
setuptools. This was covered in a previous recipe; refer to the See also section if necessary. In order to install the development version, you will need Git. Installing Git is beyond the scope of this book.
Choose the install option appropriate for you:
easy_install, using any one of the following commands:
$ easy_install line_profiler $ pip install line_profiler
Check out the source with Git:
$ git clone https://github.com/rkern/line_profiler ...