Install:
%install_ext https://raw.github.com/tkf/ipython-hierarchymagic/master/hierarchymagic.py
Screenshot:
`%hierarchy` and `%%dot` magics for IPython
Hello
I do have this issue when trying working with python 3.6
[I 08:35:14.562 LabApp] Kernel restarted: 88886d5b-3e6f-47a0-a679-f3be6db87982
[IPKernelApp] WARNING | Error in loading extension: hierarchymagic
Check your config files in /root/.ipython/profile_default
Traceback (most recent call last):
File "/root/miniconda2/envs/snake36/lib/python3.6/site-packages/IPython/core/shellapp.py", line 244, in init_extensions
self.shell.extension_manager.load_extension(ext)
File "/root/miniconda2/envs/snake36/lib/python3.6/site-packages/IPython/core/extensions.py", line 86, in load_extension
if mod.file.startswith(self.ipython_extension_dir):
AttributeError: module 'hierarchymagic' has no attribute 'file'
Yes, and it's ugly Windows behavior, and it happens with almost any Python script calling CLI command that's written on *nix. Who would expect... ;)
Here is a patch for this case:
--- hierarchymagic.bak
+++ hierarchymagic.py
@@ -99,12 +99,17 @@
def run_dot(code, options=[], format='png'):
+ import os
# mostly copied from sphinx.ext.graphviz.render_dot
from subprocess import Popen, PIPE
from sphinx.util.osutil import EPIPE, EINVAL
dot_args = ['dot'] + options + ['-T', format]
- p = Popen(dot_args, stdout=PIPE, stdin=PIPE, stderr=PIPE)
+ if os.name == 'nt':
+ p = Popen(dot_args, stdout=PIPE, stdin=PIPE, stderr=PIPE,
+ creationflags=0x08000000)
+ else:
+ p = Popen(dot_args, stdout=PIPE, stdin=PIPE, stderr=PIPE)
wentwrong = False
try:
# Graphviz may close standard input when an error occurs,
Hi,
The extension looks glorious on a demo I recently saw.
With %install_ext deprecated on Jupyter, is there a way to install the magic now?
Thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.