install pydot and graphviz for win10
来源:互联网 发布:淘宝美工素材网站 编辑:程序博客网 时间:2024/06/06 10:05
环境:Windows10(64bit) Anaconda python3.6首先用pip安装,在命令窗口输入pip install pydotpip install graphviz然后在pycharm输入代码:import pydotedg = [(1,2), (1,3), (1,4) , (3,4)]g=pydot.graph_from_edges(edg)g.write_jpeg('graph.jpg', prog = 'dot')
出错提示:
raise ImportError :Failed to import pydot. You must install pydot and graphviz for `pydotprint` to work.
原因是不能用pip安装graphviz
解决步骤1
http://www.graphviz.org/Download_windows.PHP
下载graphviz-2.38.msi 双击安装时,选择 for everyone。并设置path环境变量:我的电脑——属性——高级——环境变量——Path——编辑——新建,添加地址
C:\Program Files (x86)\Graphviz2.38\bin (这是我的安装路径) 后点击确定
然后编译。还是不成功。
解决步骤2
在命令窗口输入:
pip install python-graphviz
然后编译,还是不行,还是出错:Exception: "dot.exe" not found in path.
解决步骤3:
在pycharm加入两行代码后,即
import osos.environ["PATH"] += os.pathsep + 'C:/Program Files (x86)/Graphviz2.38/bin'import pydotedg = [(1,2), (1,3), (1,4) , (3,4)]g=pydot.graph_from_edges(edg)g.write_jpeg('graph.jpg', prog = 'dot')
然后编辑。成功啦~
捣弄了近一个小时,终于可以愉快地画图啦~
还可以画keras的模型的图
from keras.utils import plot_modelplot_model(model, to_file='model.png', show_shapes=False, show_layer_names=True, rankdir='TB')
代码来自:
别人的博客。忘记网址了,以后再补上。
阅读全文
0 0
- install pydot and graphviz for win10
- Failed to import pydot. You must install pydot and graphviz for `pydotprint` to work.
- ImportError: Failed to import pydot. You must install pydot and graphviz for `pydotprint` to work.
- Failed to import pydot. You must install pydot and graphviz for `pydotprint` to work.
- Failed to import pydot. You must install pydot and graphviz for `pydotprint` to work.
- Failed to import pydot. You must install pydot and graphviz...-keras使用pydot出错(ubuntu16.04)
- Generating Graph Visualizations with pydot and Graphviz
- python的数据可视化 graphviz pydot安装配置(win10)
- python的数据可视化 graphviz pydot安装配置(win10)
- keras可视化pydot graphviz问题
- install linux and win10
- pydot.InvocationException: GraphViz'sexecutables not found
- 170926 windows 下安装pydot与graphviz
- install and config docker toolbox in win10
- keras可视化遇到pydot&graphviz无法导入问题
- keras2可视化遇到pydot&graphviz无法导入问题
- keras可视化遇到pydot&graphviz无法导入问题(mac)
- keras模型可视化pydot-ng 和 graphviz安装问题(ubuntu)
- Nginx负载均衡与高可用的实现
- python_tornado
- centos7下git安装及使用
- ContOS7.X 下 安装 MySql
- 机器学习之条件随机场(CRF)
- install pydot and graphviz for win10
- bzoj3997 [TJOI2015]组合数学
- ScrollView 嵌套RecyclerView只显示一行
- web前端面试问题
- 【JAVA-Mybatis】MyBatis 常用逻辑符号转换
- RabbitMQ插件--Trace的使用
- PAT (Top Level) Practise1019Separate the Animals (35)
- nodejs与RESTful API
- logback 日志总结