Giter VIP home page Giter VIP logo

dotmagic's People

Contributors

sursingh avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Forkers

tjader

dotmagic's Issues

FileNotFoundError: [Errno 2] No such file or directory: 'inkscape'

I'm not going to troubleshoot this since I have an alternative solution for my immediate needs, but just wanted to note that it didn't work out of the box for me.

%%dot -p
digraph {
    node [color="${color}" style="${style}"]
    a -> {b c}
}

Gave me this:

---------------------------------------------------------------------------
FileNotFoundError                         Traceback (most recent call last)
<ipython-input-83-7686923d6ccf> in <module>
----> 1 get_ipython().run_cell_magic('dot', '-p', 'digraph {\n    node [color="${color}" style="${style}"]\n    a -> {b c}\n}\n')

~/.pyenv/versions/3.8.6/envs/p3/lib/python3.8/site-packages/IPython/core/interactiveshell.py in run_cell_magic(self, magic_name, line, cell)
   2379             with self.builtin_trap:
   2380                 args = (magic_arg_s, cell)
-> 2381                 result = fn(*args, **kwargs)
   2382             return result
   2383 

<decorator-gen-119> in dot(self, line, cell)

~/.pyenv/versions/3.8.6/envs/p3/lib/python3.8/site-packages/IPython/core/magic.py in <lambda>(f, *a, **k)
    185     # but it's overkill for just that one bit of state.
    186     def magic_deco(arg):
--> 187         call = lambda f, *a, **k: f(*a, **k)
    188 
    189         if callable(arg):

~/.pyenv/versions/3.8.6/envs/p3/lib/python3.8/site-packages/dotmagic/dotmagic.py in dot(self, line, cell)
    101     def dot(self, line, cell=None):
    102         opts, line = self._do_args(line)
--> 103         return self._do_magic(opts, line, cell)
    104 
    105     @line_magic

~/.pyenv/versions/3.8.6/envs/p3/lib/python3.8/site-packages/dotmagic/dotmagic.py in _do_magic(self, opts, line, cell)
     88 
     89         if 'p' in opts:
---> 90             cmd = self._svg_to_png(cmd)
     91             image_type = Image
     92 

~/.pyenv/versions/3.8.6/envs/p3/lib/python3.8/site-packages/dotmagic/dotmagic.py in _svg_to_png(self, s)
     64         _, tmpf = tempfile.mkstemp(dir=self._tmpdir, suffix='.png')
     65         cmd = ['inkscape', '-p', '-o', tmpf]
---> 66         return s.pipe(cmd, outfile=tmpf)
     67 
     68     def _do_args(self, line):

~/.pyenv/versions/3.8.6/envs/p3/lib/python3.8/site-packages/dotmagic/dotmagic.py in pipe(self, cmd, outfile)
     33 
     34     def pipe(self, cmd, outfile=None):
---> 35         return Cmd(cmd, self._proc.stdout, outfile=outfile)
     36 
     37     def __or__(self, other):

~/.pyenv/versions/3.8.6/envs/p3/lib/python3.8/site-packages/dotmagic/dotmagic.py in __init__(self, cmd, stdin, stdout, stderr, outfile)
     16 
     17     def __init__(self, cmd, stdin=PIPE, stdout=PIPE, stderr=None, outfile=None):
---> 18         self._proc = Popen(cmd, stdin=stdin, stdout=stdout, stderr=stderr)
     19         self._outfile = outfile
     20 

~/.pyenv/versions/3.8.6/lib/python3.8/subprocess.py in __init__(self, args, bufsize, executable, stdin, stdout, stderr, preexec_fn, close_fds, shell, cwd, env, universal_newlines, startupinfo, creationflags, restore_signals, start_new_session, pass_fds, encoding, errors, text)
    852                             encoding=encoding, errors=errors)
    853 
--> 854             self._execute_child(args, executable, preexec_fn, close_fds,
    855                                 pass_fds, cwd, env,
    856                                 startupinfo, creationflags, shell,

~/.pyenv/versions/3.8.6/lib/python3.8/subprocess.py in _execute_child(self, args, executable, preexec_fn, close_fds, pass_fds, cwd, env, startupinfo, creationflags, shell, p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite, restore_signals, start_new_session)
   1700                     if errno_num != 0:
   1701                         err_msg = os.strerror(errno_num)
-> 1702                     raise child_exception_type(errno_num, err_msg, err_filename)
   1703                 raise child_exception_type(err_msg)
   1704 

FileNotFoundError: [Errno 2] No such file or directory: 'inkscape'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.