Open astrofrog opened 6 years ago
objgraph contains code to detect when it's running in Jupyter and display the graph inline in the Jupyter console. This is very likely a bug in that code!
See https://github.com/mgedmin/objgraph/issues/23#issuecomment-261920239 and https://github.com/mgedmin/objgraph/pull/28 for more details.
Question: do you have https://pypi.python.org/pypi/graphviz installed?
@mgedmin - in some cases I do see a graph inline in Jupyter but I still want to have the ability to export the plot to a file (which it doesn't seem to let me do). In the case above the graph is empty which is why I see nothing in the second case. So the inline drawing does work, it's more that it seems to then not allow exporting to files even if asked explicitly. I'll check later today if I had the PyPI graphviz package installed
You should be able to export to a file, if you explicitly specify filename='foo.png'
etc. If that doesn't work as well, that could be another bug.
I'm unable to reproduce the problem using Jupyter QtConsole 4.2.1 on Python 3.6.3/IPython 5.1.0:
You should be able to export to a file, if you explicitly specify filename='foo.png' etc. If that doesn't work as well, that could be another bug.
This is what I was trying and it didn't work either. I'll post specific version information when I'm back at a computer.
You should be able to export to a file, if you explicitly specify filename='foo.png' etc. If that doesn't work as well, that could be another bug.
This is what I was trying and it didn't work either. I'll post specific version information when I'm back at a computer.
That part was broken but is now fixed in https://github.com/mgedmin/objgraph/commit/a729c406d0fa886daa89935e0a77469dd97b2f45.
I don't know if this issue which happens in environments created in conda falls under the jurisdiction of this issue. The environment in question is Python 3.7.9 <build - h60c2a47_0> made by conda. I installed Graphviz 2.38 <build - hfd603c8_2> from conda, Objgraph 3.5.0, python-graphviz 0.14.2 and xdot 1.1 from pip. To test the setup out, I ran the basic code given in the documentation (yes, the very first one). The xdot package was not detected I guess. p.s. - I'm sorry for necroposting.
@rediffp is the dot
tool on your $PATH? If yes, please file another bug because the detection in objgraph is broken. If not, that's your problem and it's not really a bug -- how is objgraph supposed to find a binary executable installed somewhere, when it's not on the PATH?
If I use objgraph in an IPython session things work as expected:
However if I use
jupyter qtconsole
there is no output fromshow_backrefs
, and if I try and specify an output filename, nothing happens:what could be going on?