Code Monkey home page Code Monkey logo

Comments (16)

parrt avatar parrt commented on May 13, 2024

weird. does dot work from command line @jlw365 ? It looks like it can't find dot.

from dtreeviz.

p9anand avatar p9anand commented on May 13, 2024

getting same issue. Although i have the dot.
screen shot 2018-12-06 at 3 52 45 pm

from dtreeviz.

parrt avatar parrt commented on May 13, 2024

Try running the code from cmdline then not notebook to see if it works. that will isolate the issue to a path problem in notebook.

from dtreeviz.

p9anand avatar p9anand commented on May 13, 2024

Hi Thanks for reverting back. still having same issue. Please find attached file.
screenshot 2018-12-07 at 10 50 05 pm

from dtreeviz.

parrt avatar parrt commented on May 13, 2024

Ah. ok, it's finding dot but can't handle the svg stuff. That is a mac? try these updated instructions:

Make sure to have the latest XCode installed and command-line tools installed. You can run xcode-select --install from the command-line to install those if XCode is already installed. You also have to sign the XCode license agreement, which you can do with sudo xcodebuild -license from command-line. The brew install shown next needs to build graphviz, so you need XCode set up properly.

You need the graphviz binary for dot installed with librsvg and pango. Make sure you uninstall graphviz then reinstall or install like this:

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

(The --with-librsvg is absolutely required because we generate output using dot's -Tsvg:cairo option. I have used --with-app successfully also but others have trouble installing with that.)

from dtreeviz.

motoki0214 avatar motoki0214 commented on May 13, 2024

I struggled the same issue then I could solve them with the information here.
Thank you so much for your helpful information, @parrt.

from dtreeviz.

parrt avatar parrt commented on May 13, 2024

@motoki0214 glad to hear it. What specifically solved your problem so I can update the doc? Was the uninstall then install? correct brew options?

from dtreeviz.

motoki0214 avatar motoki0214 commented on May 13, 2024

@parrt
I did what you said things below,

1, type "xcode-select --install" from the command-line
2, then run "sudo xcodebuild -license" from the command-line
3, "uninstall graphviz" from the command-line once
4, then finally run "brew install graphviz --with-librsvg --with-pango" on command-line
5, A sample decision tree was shown on Jupyter notebook with "display(viz)" or "viz"

FYI ;
I am running Python 3.6.4 :: Anaconda, Inc. in the Jupyter notebook.
also already Xcode was installed in my mac.

from dtreeviz.

parrt avatar parrt commented on May 13, 2024

great. added to doc

from dtreeviz.

motoki0214 avatar motoki0214 commented on May 13, 2024

@parrt
My pleasure.
This library is very useful for my job, thank you very much too.

from dtreeviz.

JosephGatto avatar JosephGatto commented on May 13, 2024

I have tried all of the suggestions from all of these threads, everything installs successfully yet I still get:
CalledProcessError: Command '['dot', '-Tsvg:cairo', '-o', .... ] (on mac)

Since I am not too worried about quality, my work around was to go to the trees.py file and change line 89 to:
cmd = ["dot", f"-Tsvg:svg:core", "-o", filename, dotfilename]

git

Now this doesn't fix viz.view() for me but it does allow me to save .png. Better than nothing!

--
By the way, awesome library @parrt thank you

from dtreeviz.

parrt avatar parrt commented on May 13, 2024

That is so weird. If you try dot with svg from the command line and it doesn't work, then that is some kinda weird install issue unrelated to dtreeviz. Nonetheless, glad you found a way around it.

from dtreeviz.

parrt avatar parrt commented on May 13, 2024

@JosephGatto That -Tsvg:svg:core thing didn't work for me. How did you use that route to get png? Trying to update package. thanks! This seems to work though:

dot -o foo.png -Tpng foo.dot

from dtreeviz.

JosephGatto avatar JosephGatto commented on May 13, 2024

@JosephGatto That -Tsvg:svg:core thing didn't work for me. How did you use that route to get png? Trying to update package. thanks! This seems to work though:

dot -o foo.png -Tpng foo.dot

@parrt So my reasoning for that was Jupyter warnings stating something telling me to use that package instead. I then just went into the source code and replaced the original call.

It worked for a bit but I have since tried uninstalling / reinstalling dtreeviz as that workflow was painful. My hacky solution stopped working after that and I resulted in giving up on trying to get it to work on my mac and switched to windows. Sorry this response isn't more helpful!

from dtreeviz.

parrt avatar parrt commented on May 13, 2024

@JosephGatto no problem. I have updated the README to have new instructions but I'm working on a png thing now too :)

from dtreeviz.

parrt avatar parrt commented on May 13, 2024

@JosephGatto Can you try the new build from source instructions on the homepage? It works for me on to Macs.

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.