PixieDebugger – A Visual Python Debugger for Jupyter Notebooks Every Data Scientist Should Use

Pranav Dar Last Updated : 07 May, 2019
2 min read

Overview

  • PixieDebugger is a powerful visual debugger for Python that works in Jupyter Notebooks
  • It comes with multiple features, including a source editor and a code execution controlling toolbar
  • It works as a magic command and requires PixieDust as a prerequisite

 

Introduction

Picture this – you think you’ve designed a phenomenal model using tons of lines of code but there’s a pesky error in there. It’s holding back the model from achieving it’s full power but you can’t quite figure out what’s wrong. Sure, you could use Jupyter’s pdb but wouldn’t it be awesome to visually debug that code block within an interactive environment? I’ve got some awesome news for you!

PixieDebugger, developed by the PixieDust team, claims to be the first visual debugger for Python that works exclusively with Jupyter Notebooks. Note that it doesn’t yet work with JupyterLab but the developers might be working on fixing this soon. The PixieDebugger comes packaged with multiple features, including:

  • A source editor
  • Console output feature
  • Local variable inspector
  • Breakpoint management
  • Code execution controlling toolbar

Keep in mind that you need to install PixieDust as a prerequisite before using this debugger. To do so, simply go to command prompt/terminal, and paste the following:

pip install pixiedust

Before you start using it, you’ll need to import it first:

import pixiedust

Now you’re ready! Invoke this awesome tool as a magic command using the simple below code:

%%pixie_debugger

And voila! Now try this out on any code block you have open in your Jupyter notebook and you’ll start to see the magic.

Check out the below video which shows how PixieDebugger works in a Jupyter Notebook environment:

 

Our take on this

I’ve been using Jupyter Notebooks more and more lately (I’m started using Python recently after switching over from R), so this feels like the icing on the cake. Having tried PixieDebugger out extensively, I can vouch for how easy and helpful it make my coding experience. I encourage all data scientists to try it out as well, it’s sure to become a very handy tool for you.

In case you are a beginner with Python and/or Jupyter Notebooks, go through this article which comprehensively covers all aspects of this wonderful IDE and why you should use it next time you start working on a new project or dataset.

 

Subscribe to AVBytes here to get regular data science, machine learning and AI updates in your inbox!

 

Senior Editor at Analytics Vidhya.Data visualization practitioner who loves reading and delving deeper into the data science and machine learning arts. Always looking for new ways to improve processes using ML and AI.

Responses From Readers

Clear

Jordi
Jordi

Hello! Good post, but I am using Colab and I have problems using %%pixie_debugger. I properly installed and imported pixiedust, but when I try to run %%pixie_debugger a invalid syntax error shows up. Is another way to use pixie in colab?

We use cookies essential for this site to function well. Please click to help us improve its usefulness with additional cookies. Learn about our use of cookies in our Privacy Policy & Cookies Policy.

Show details