Python 如何在 Windows 10 上安装 graphviz-2.38
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/45092771/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to install graphviz-2.38 on windows 10
提问by adurbin
I know this is basic, but I'm pretty stuck. I've never installed python packages on Windows OS before... only Linux.
我知道这是基本的,但我很困惑。我以前从未在 Windows 操作系统上安装过 python 包……只有 Linux。
I downloaded the graphviz-2.38 zip and moved it to my Anaconda packages directory. I unzipped it, and then on the command line tried:
我下载了 graphviz-2.38 zip 并将其移动到我的 Anaconda 包目录。我解压缩它,然后在命令行上尝试:
C:\Users\name\Anaconda3\pkgs\graphviz-2.38> pip install graphviz-2.38
This is the error I got:
这是我得到的错误:
Could not find a version that satisfies the requirement graphviz-2.38 (from
versions: )
No matching distribution found for graphviz-2.38
I don't see any setup file within graphviz at all, so I'm a little lost.
我在graphviz中根本看不到任何安装文件,所以我有点迷茫。
采纳答案by Rao
Just use:
只需使用:
pip install graphviz
回答by HassanSh__3571619
If you are using Conda, then run the following: conda install -c anaconda graphviz
如果您使用的是 Conda,请运行以下命令: conda install -c anaconda graphviz
Be sure though to run the conda cmd as Admin for avoiding privileges permission errors. The above command will update / install all the requirement, and graphviz will be available in the default environment at C:\ProgramData\Anaconda3 (for windows...Not sure for MAC).
请务必以管理员身份运行 conda cmd 以避免特权权限错误。上面的命令将更新/安装所有要求,graphviz 将在 C:\ProgramData\Anaconda3 的默认环境中可用(对于 Windows...Mac 不确定)。
回答by Hemerson Tacon
I faced the same issue and just pip install graphviz
didn't work for me.
In addition, I installed the binariesand set the bin folder in the Windows environment PATH
variable, and then it worked.
我遇到了同样的问题,只是pip install graphviz
对我不起作用。另外,我安装了二进制文件并在 Windows 环境PATH
变量中设置了 bin 文件夹,然后它就可以工作了。
P.S. this solution installs the 0.8.2 version but works for keras.utils.vis_utils.plot_model
which was the problem for me
PS 此解决方案安装 0.8.2 版本但适用keras.utils.vis_utils.plot_model
于我的问题
回答by Jeril
For me just installing the graphviz
library dint work. It was not able to open dot
files. So I had to do the following:
对我来说只是安装graphviz
库 dint 工作。它无法打开dot
文件。所以我不得不做以下事情:
- Download the stable
Graphviz
version by clickingStable 2.38 Windows install packages
from here - Install
Graphviz
library usingpip install graphviz
- Since you're using windows, check out the installed tool called GVEdit (just search in the start menu), it makes the whole process slightly easier.
- The
dot
files can be opened by selectingFile --> Open
- 下载稳定的
Graphviz
点击版本Stable 2.38 Windows install packages
从这里 Graphviz
使用安装库pip install graphviz
- 由于您使用的是 Windows,请查看已安装的名为 GVEdit 的工具(只需在开始菜单中搜索),它会使整个过程稍微简单一些。
- 该
dot
文件可以通过选择打开File --> Open
回答by Peter Chen
I got "GraphViz's Executables not found" when I tried the program "https://www.w3schools.com/python/showpython.asp?filename=demo_ml_dtree4"
当我尝试程序“ https://www.w3schools.com/python/showpython.asp?filename=demo_ml_dtree4”时,我得到“找不到GraphViz的可执行文件”
I tried 1. "pip install graphviz" or 2. "conda install graphviz". Both of them are not worked for me.
我尝试了 1.“pip install graphviz”或 2.“conda install graphviz”。他们两个都不适合我。
I solve the problem for WIndows-10 as follows:
我解决了 WINdows-10 的问题如下:
- Go to gephiviz web site: http://wingraphviz.sourceforge.net/wingraphviz/
- Setup environment variables, path="...;c:\Program Files (x86)\Graphviz2.38\bin;"
- Save the path
- Open the Prompt and check the "Graphviz" path.
- Re-execute the program, the tree is visiualized now.
- 转到 gephiviz 网站:http://wingraphviz.sourceforge.net/wingraphviz/
- 设置环境变量,path="...;c:\Program Files (x86)\Graphviz2.38\bin;"
- 保存路径
- 打开提示并检查“Graphviz”路径。
- 重新执行程序,现在树被可视化了。
回答by Thomas Negash
For Conda users:
对于 Conda 用户:
1.
conda install graphviz
1.
conda install graphviz
2.
conda install python-graphviz
2.
conda install python-graphviz