- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
我需要通过 pydot 构建一个 pythonic 图形解决方案,当我尝试运行一个简单的代码时:
import pydot
graph = pydot.Dot(graph_type='graph')
i=1
edge = pydot.Edge("A", "B%d" % i)
graph.add_edge(edge)
graph.write_png('graph.png')
它旨在在 png 文件上构建一个简单的图形 (A-B1)。在修复了很多错误配置之后,现在我得到了:
Traceback (most recent call last):
File "/Users/zallaricardo/Documents/Python/test_png.py", line 7, in <module>
graph.write_png('graph.png')
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pydot.py", line 1809, in <lambda>
lambda path, f=frmt, prog=self.prog : self.write(path, format=f, prog=prog))
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pydot.py", line 1911, in write
dot_fd.write(self.create(prog, format))
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pydot.py", line 2023, in create
status, stderr_output) )
pydot.InvocationException: Program terminated with status: 1. stderr follows: Format: "png" not recognized. Use one of:
logout
直到现在还找不到适合我的特定环境的直接解决方案。关于如何修复它的任何提示?需要为 python 2.7 和 mac os x 10.9 工作。
我当前安装的包:
cycler==0.9.0
decorator==4.0.4
graphviz==0.4.7
matplotlib==1.5.0
networkx==1.10
numpy==1.10.1
pydot2==1.0.33
pyparsing==1.5.7
PyPDF2==1.25.1
python-dateutil==2.4.2
pytz==2015.7
six==1.10.0
wheel==0.26.0
我只想达到 https://pythonhaven.wordpress.com/2009/12/09/generating_graphs_with_pydot/ 中显示的相同结果
最佳答案
关于python - Pydot 错误 : file format "png" not recognized,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33678636/
我在 Python(3.5 版)中尝试使用语音识别模块,但遇到了以下错误: 'AttributeError: 'Recognizer' object has no attribute 'recogni
我正在尝试编译 C++ 程序,但遇到一些问题。特别是,当我使用 x86_64-w64-mingw32-gcc 作为编译器时,它在编译过程中提示“tmp/src/libfastms/solver/sol
我正在尝试安装 R 的 plyr 包。这是错误消息: * installing *source* package ‘plyr’ ... ** package ‘plyr’ successfully u
我第一次尝试使用多个文件构建程序。只用 main.cpp 编译程序我从来没有遇到过任何问题。使用以下命令,结果如下: $ g++ -c src/CNumber.cpp src/CNumber.h -o
我正在努力通过 The Little Book About OS Development ,特别是关于帧缓冲区的部分(链接)。我能够成功地汇编、链接、转换成 ISO 文件并启动纯程序集,但是一旦我尝试
我有一个关于 Swift 中 UIPanGestureRecognizer 的奇怪案例。我有一个处理平移手势的函数,并在 UIGestureRecognizerDelegate 中指定“false”,
抱歉,标题太长了。 我正在尝试将我们的功能测试代码与我们的集成测试代码隔离开来,并使用 gradle 任务让它工作。它也有 95% 在 intellij 中工作,除了每次我做一个“gradle ide
我想编写一个软件,当 USB 拇指驱动器连接到 USB 端口时,它会自动将一些文件复制到 USB 拇指驱动器上。为此我想知道: 我如何编写一个 c++ 应用程序,在 USB 拇指驱动器连接时收到通知?
我现在正在使用 BACKTRACK 5,它几乎像 ubuntu,一个 debian 和它的 32 位,我安装了 nasm,我去看了 dr. paulcarter 的汇编语言教程并下载了他的示例程序 (
我正在尝试编译一个包含以下行的 makefile: gcc -I. -I/home/usr/Documents/MTV/include -ggdb3 -Wall -O2 -o ascii2bin.c
我去了Chocolatey website并复制安装文本并粘贴到管理员 cmd.exe(使用 Windows 7)。当我运行命令时,我得到: 'powershell' is not recognize
我目前正在使用 Eventstore,但收到以下错误:Could not recognize BadRequest; 来自: game process tick failed UnknownError
我正在使用 jquery-1.11.1,并尝试使用 :data 选择器,如上所述 https://api.jqueryui.com/data-selector/ 尝试查找具有特定键的所有元素,如下所示
我有一个滚动功能,我需要执行它来滚动到其容器中的最后一条消息,该容器是带有 chunk_id 的容器。问题是它按原样进入容器,但如果我将最后一个子添加到混合中,该功能将不起作用。有什么想法我做错了吗?
我正在使用 sphinx4 暂停线程,直到说出特定的关键字。第一次效果很好,但第二次我需要暂停线程, recognizer.recognize() 似乎没有运行,应用程序只是开始发送垃圾邮件“开始说话
我正在尝试检查我的应用程序是否被授予访问用户提醒的权限,方法是: EKEventStore *store = [[EKEventStore alloc] init]; EKAuthorizationS
我有一个 foo 对象,如下所示: var foo = { "timer" : { "hours" : 0, "minutes" : 0,
我正在尝试运行位于此处的代码: http://r3dux.org/2010/11/single-call-opengl-texture-loader-in-devil/ 而且它需要我使用 DevIL,
我交叉编译了arm的内核源代码,带有调试信息和KGDB。 当我在主机中运行 gdb 时: $ arm-linux-gnueabihf-gdb vmlinux ... Reading symbols f
我使用 pip 将 virtualenv 安装到我的项目目录中。但是,当我在 Windows 终端中运行命令 virtualenv venv 时,它只是告诉我它无法识别。 我必须在 Python 中做
我是一名优秀的程序员,十分优秀!