GithubHelp home page GithubHelp logo

Comments (16)

vlavorini avatar vlavorini commented on September 26, 2024 82

I confirm what @guifeliper wrote work also on MacOS: you have to install graphviz on the system (brew install graphviz) and not with Pip.

from data-analysis.

sviperm avatar sviperm commented on September 26, 2024 46

I solved it by installing pydot and graphiz with command
sudo apt install python-pydot python-pydot-ng graphviz
ref

from data-analysis.

bo-maxwell-stevens avatar bo-maxwell-stevens commented on September 26, 2024 11

This worked for me in virtual machine with anaconda:
sudo apt install graphviz

from data-analysis.

jyoz90 avatar jyoz90 commented on September 26, 2024 9

Same error here. after i install pydot and graphviz, still getting the error. Any advise on how to solve this? Thanks!

from data-analysis.

guifeliper avatar guifeliper commented on September 26, 2024 6

@jyoz90 you need to download the binary as well, that worked for me.
apk add --update --no-cache graphviz

from data-analysis.

hpl002 avatar hpl002 commented on September 26, 2024 1

I confirm what @guifeliper wrote work also on MacOS: you have to install graphviz on the system (brew install graphviz) and not with Pip.

Any idea why this is needed?

Installing via homebrew simply installs the binary in /usr/local/Cellar as opposed to pip which installs in /usr/local/lib/python@version/site-packages.

Both are available on PATH so i struggle to see why there would be a difference, even though there definitely is..

from data-analysis.

haodong2000 avatar haodong2000 commented on September 26, 2024 1

sudo apt install graphviz

thanks!!

from data-analysis.

Alrabef avatar Alrabef commented on September 26, 2024 1

The solution using "brew install graphviz" works very fine after trying to do something in Python. Thankyou @guifeliper

from data-analysis.

tanjhysj0 avatar tanjhysj0 commented on September 26, 2024

thanks

我通过使用命令ref安装pydot和graphiz解决了它
sudo apt install python-pydot python-pydot-ng graphviz

from data-analysis.

calvin272m avatar calvin272m commented on September 26, 2024

FileNotFoundError Traceback (most recent call last)
~/opt/anaconda3/lib/python3.7/site-packages/pydot.py in create(self, prog, format, encoding)
1914 arguments=arguments,
-> 1915 working_dir=tmp_dir,
1916 )

~/opt/anaconda3/lib/python3.7/site-packages/pydot.py in call_graphviz(program, arguments, working_dir, **kwargs)
135 stdout=subprocess.PIPE,
--> 136 **kwargs
137 )

~/opt/anaconda3/lib/python3.7/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)
774 self._closed_child_pipe_fds = False
--> 775
776 try:

~/opt/anaconda3/lib/python3.7/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)
1521 pass
-> 1522
1523 try:

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

During handling of the above exception, another exception occurred:

FileNotFoundError Traceback (most recent call last)
in
----> 1 plot_tree(regressionTree, ['Years','Hits'])

in plot_tree(estimator, features, class_names, filled)
11 precision = 2)
12 graph = pydot.graph_from_dot_data(dot_data.getvalue())[0]
---> 13 return Image(graph.create_png())

~/opt/anaconda3/lib/python3.7/site-packages/pydot.py in new_method(f, prog, encoding)
1721 """Refer to docstring of method create."""
1722 return self.create(
-> 1723 format=f, prog=prog, encoding=encoding)
1724 name = 'create_{fmt}'.format(fmt=frmt)
1725 self.setattr(name, new_method)

~/opt/anaconda3/lib/python3.7/site-packages/pydot.py in create(self, prog, format, encoding)
1920 args[1] = '"{prog}" not found in path.'.format(
1921 prog=prog)
-> 1922 raise OSError(*args)
1923 else:
1924 raise

FileNotFoundError: [Errno 2] "dot" not found in path.

I 'brew install graphviz' , but still has this problem. what I did is following the introduction to statistic learning by python, before this code, there is a code to find the location of graphviz

find the location of graphviz so dot.exe is in the PATH

import os
common_path = os.path.commonpath([path for path in os.environ["PATH"].split(';') if 'Anaconda' in path])
dot_path = os.path.join(common_path, 'Library', 'bin', 'graphviz')
os.environ["PATH"] += os.pathsep + dot_path
but my case is no 'Anaconda' capitalized A, I used 'anaconda' instead, that's all.
Then I got the error message.

from data-analysis.

mikechen66 avatar mikechen66 commented on September 26, 2024

While in the virtual environment, the following installation methods does not works

sudo apt install python-pydot python-pydot-ng graphviz

from data-analysis.

forumasisten avatar forumasisten commented on September 26, 2024

I solved it by installing pydot and graphiz with command
sudo apt install python-pydot python-pydot-ng graphviz
ref

ThankYou!!!!!!!!!!

from data-analysis.

rosefun avatar rosefun commented on September 26, 2024

What about Red Hat system?

from data-analysis.

jorge-cue avatar jorge-cue commented on September 26, 2024

What about Red Hat system?

This worked for me on Fedora 36

sudo dnf install graphviz

from data-analysis.

charleschen0611 avatar charleschen0611 commented on September 26, 2024

I confirm what @guifeliper wrote work also on MacOS: you have to install graphviz on the system (brew install graphviz) and not with Pip.

And the Homebrew command from @vlavorini works with Jupyter Notebook as well. Thanks!

from data-analysis.

himra13 avatar himra13 commented on September 26, 2024

I confirm that this works on macbook. Thank you so much

I confirm what @guifeliper wrote work also on MacOS: you have to install graphviz on the system (brew install graphviz) and not with Pip.

from data-analysis.

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.