Somewhere in my library code I have a matplotlib.pyplot
import. When I import one of my library modules I see that pyplot ends up getting imported (as evidenced by the fact that, in ipython notebook, my notebook immediately crashes because I did not run %matplotlib inline).
How can I get a stacktrace showing the sequence of imports (starting with my library module import) that resulted in pyplot getting imported? So far I have tried using sed to replace all my instances of
from matplotlib import pyplot as plt
to
import pdb; pdb.set_trace(); from matplotlib import pyplot as plt
but that hasn't turned it up yet.