Giter Club home page Giter Club logo

Comments (8)

parrt avatar parrt commented on May 14, 2024 2

actually, i guess in notebooks you never call viz.view(). should be just a ref to viz which is an object that notebooks know how to display.

from dtreeviz.

H4dr1en avatar H4dr1en commented on May 14, 2024 1

I had the same issue with Jupyter Lab on Linux. Easy fix: calling viz instead of viz.view() works fine, as shown in the notebooks inside the repo.

from dtreeviz.

parrt avatar parrt commented on May 14, 2024

mac? windows? anaconda?

from dtreeviz.

XiangYangAI avatar XiangYangAI commented on May 14, 2024

The remote server is Ubuntu with anaconda virtual environment and I log in jupyter-lab on mac.

from dtreeviz.

XiangYangAI avatar XiangYangAI commented on May 14, 2024

If I run all things on mac without using remote Ubuntu. Errors occur as follows:

Format: "svg:cairo" not recognized. Use one of: svg:svg:core
---------------------------------------------------------------------------
CalledProcessError                        Traceback (most recent call last)
<ipython-input-4-d2742afb20d1> in <module>
----> 1 viz.view()

~/anaconda3/lib/python3.6/site-packages/dtreeviz/trees.py in view(self)
     66         tmp = tempfile.gettempdir()
     67         svgfilename = f"{tmp}/DTreeViz_{getpid()}.svg"
---> 68         self.save(svgfilename)
     69         view(svgfilename)
     70 

~/anaconda3/lib/python3.6/site-packages/dtreeviz/trees.py in save(self, filename)
     89             cmd = ["dot", f"-T{format}:cairo", "-o", filename, dotfilename]
     90             # print(' '.join(cmd))
---> 91             stdout, stderr = run(cmd, capture_output=True, check=True, quiet=False)
     92 
     93         else:

~/anaconda3/lib/python3.6/site-packages/graphviz/backend.py in run(cmd, input, capture_output, check, quiet, **kwargs)
    157         stderr_write_bytes(err, flush=True)
    158     if check and proc.returncode:
--> 159         raise CalledProcessError(proc.returncode, cmd, output=out, stderr=err)
    160 
    161     return out, err

CalledProcessError: Command '['dot', '-Tsvg:cairo', '-o', '/var/folders/mn/3rsprdf53zqfhr_z6nswd5340000gn/T/DTreeViz_41460.svg', '/var/folders/mn/3rsprdf53zqfhr_z6nswd5340000gn/T/DTreeViz_41460']' returned non-zero exit status 1.

from dtreeviz.

parrt avatar parrt commented on May 14, 2024

that is the brew install issue I think. did you do

brew install graphviz --with-librsvg --with-pango

Try uninstall graphviz then do that.

from dtreeviz.

parrt avatar parrt commented on May 14, 2024

i pushed 0.4 last night. can you see if that works for you as well?

from dtreeviz.

H4dr1en avatar H4dr1en commented on May 14, 2024

I installed dtreeviz yesterday using the master branch (installing from pypi didn't work, I had an error). So I have 0.4 and still need to call viz at the end of a jupyter lab cell instead of viz.view()

from dtreeviz.

Related Issues (20)

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.