- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试在 Python 中的 PyX 模块中运行。
这是一个名为“mplot.py”的简单程序:
from pyx import *
g = graph.graphxy(width=8)
g.plot(graph.data.function("y(x)=sin(x)/x", min=-15, max=15))
g.writePDFfile("function")
我想这样做是为了制作情节。
我正常运行
C:\Users\Tony>py myplot.py
但是我收到奇怪且长的错误消息:
Traceback (most recent call last):
File "myplot.py", line 4, in <module>
g.writePDFfile("function")
File "C:\Users\Tony\Programs\Python\Python37-32\lib\sitepackages\pyx\canvas.py", line 50, in wrappedindocument
return method(d, file, **write_kwargs)
File "C:\Users\Tony\Programs\Python\Python37-32\lib\site
packages\pyx\document.py", line 193, in writePDFfile
pdfwriter.PDFwriter(self, f, **kwargs)
File "C:\Users\Tony\Programs\Python\Python37-32\lib\site
packages\pyx\pdfwriter.py", line 316, in __init__
catalog = PDFcatalog(document, self, registry)
File "C:\Users\Tony\Programs\Python\Python37-32\lib\site
packages\pyx\pdfwriter.py", line 143, in __init__
self.PDFpages = PDFpages(document, writer, registry)
File "C:\Users\Tony\Programs\Python\Python37-32\lib\site
packages\pyx\pdfwriter.py", line 202, in __init__
page = PDFpage(page, pageno, self, writer, registry)
File "C:\Users\Tony\Programs\Python\Python37-32\lib\site
packages\pyx\pdfwriter.py", line 236, in __init__
self.PDFcontent = PDFcontent(page, writer, self.pageregistry)
File "C:\Users\Tony\Programs\Python\Python37-32\lib\site
packages\pyx\pdfwriter.py", line 268, in __init__
page.processPDF(contentfile, awriter, acontext, registry, self.bbox)
File "C:\Users\Tony\Programs\Python\Python37-32\lib\site
packages\pyx\document.py", line 135, in processPDF
self._process("processPDF", *args)
File "C:\Users\Tony\Programs\Python\Python37-32\lib\site
packages\pyx\document.py", line 129, in _process
getattr(cc, processMethod)(contentfile, writer, context, registry, bbox)
File "C:\Users\Tony\Programs\Python\Python37-32\lib\site
packages\pyx\graph\graph.py", line 191, in processPDF
canvas.canvas.processPDF(self, file, writer, context, registry, bbox)
File "C:\Users\Tony\Programs\Python\Python37-32\lib\site
packages\pyx\canvas.py", line 238, in processPDF
item.processPDF(file, writer, context, registry, nbbox)
File "C:\Users\Tony\Programs\Python\Python37-32\lib\site
packages\pyx\canvas.py", line 238, in processPDF
item.processPDF(file, writer, context, registry, nbbox)
File "C:\Users\Tony\Programs\Python\Python37-32\lib\site
packages\pyx\canvas.py", line 238, in processPDF
item.processPDF(file, writer, context, registry, nbbox)
[Previous line repeated 1 more time]
File "C:\Users\Tony\Programs\Python\Python37-32\lib\site
packages\pyx\text.py", line 887, in processPDF
self.dvicanvas.processPDF(file, writer, context, registry, abbox)
File "C:\Users\Tony\Programs\Python\Python37-32\lib\site
packages\pyx\text.py", line 851, in dvicanvas
self.do_finish()
File "C:\Users\Tony\Programs\Python\Python37-32\lib\site
packages\pyx\text.py", line 1212, in do_finish
self.go_finish()
File "C:\Users\Tony\Programs\Python\Python37-32\lib\site
packages\pyx\text.py", line 1338, in go_finish
self._execute("\\end%\n", self.texmessages_end_default +
self.texmessages_end, STATE_TYPESET, STATE_DONE)
File "C:\Users\Tony\Programs\Python\Python37-32\lib\site
packages\pyx\text.py", line 1125, in _execute
raise e
File "C:\Users\Tony\Programs\Python\Python37-32\lib\site
packages\pyx\text.py", line 1103, in _execute
raise TexResultError("TeX dvifile messages expected")
pyx.text.TexResultError: TeX dvifile messages expected
The expression passed to TeX was:
\end%
After parsing the return message from TeX, the following was left:
*(see the transcript file for additional information)
Output written on "C:\Users\Tony\Temp\pyx3z6ter8i\texp
ut.dvi" (25 pages, 1800 bytes).
Transcript written on "C:\Users\Tony\Temp\pyx3z6ter8i\
texput.log".
如何修复此错误并获取我的绘图?如何修复此错误并获取我的绘图?如何修复此错误并获取我的绘图?如何修复此错误并获取我的绘图?如何修复此错误并获取我的绘图?如何修复此错误并获取我的绘图?如何修复此错误并获取我的绘图?如何修复此错误并获取我的绘图?如何修复此错误并获取我的绘图?如何修复此错误并获取我的绘图?如何修复此错误并获取我的绘图?如何修复此错误并获取我的绘图?如何修复此错误并获取我的绘图?如何修复此错误并获取我的绘图?
非常感谢任何帮助。谢谢
最佳答案
您可以通过添加行来修复它
text.set(engine=text.TexEngine, texmessages_end=[text.texmessage.ignore])
紧接在导入语句之后。然而,这只会平息这个问题。适当的修复将成为 future PyX 版本的一部分(请参阅 https://github.com/pyx-project/pyx/issues/8 )。
关于python - 如何使用 Python 修复 Pyx 模块中的回溯错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57425910/
我正在尝试构建一个包含 *.pyx 文件的 Python 包 (pyregion),但在构建过程中出现错误。查看以下输出: $ python setup.py build running build
两个pyx文件, f1.pyx cpdef double func1(): return 0.01 f2.pyx from f1 cimport func1 我如何导入 func1来自 f1
似乎PyCharm中的python类型检查器自动适用于.py文件..但不适用于.pyx文件。 有什么方法可以在PyCharm中为.pyx文件启用类型检查器吗? 另外,有什么方法可以将mypy与cyth
我的 pyx 依赖于本地库 我怎样才能pyximport.install()它? pyxinstall 中的自动构建不知道与 native 库链接,因此构建失败... 最佳答案 您还可以使用 .pyx
我正在玩 cython 教程 ( http://docs.cython.org/en/latest/src/tutorial/cython_tutorial.html ) 我有一个这样的目录: som
许多可视化库和语言提供了生成任何颜色的简单方法。例如,您可以简单地添加一个带有 css 颜色代码的样式标签,以在 html 中设置对象的颜色。 是否有类似的方法可以将 pyx 绘图的颜色设置为任何想要
我是 python 的初学者,我也刚刚熟悉 cython。我在 Windows 64 位上使用 Anaconda。我正在尝试按如下方式运行“helloworld”示例: 1- 我构建了一个 hello
如何使用 Pyx 在任意两个点之间绘制一条“支撑”线? 它看起来像这样: Brace example http://tof.canardpc.com/view/d16770a8-0fc6-4e9d-b
我在运行 python 脚本时遇到错误“找不到 parser.pyx:找不到文件”,路径是当前工作目录 +“pandas_libs\parsers.pyx”。我找不到为什么 VsCode 引用 wkd
我只是想得到一个图表,但轴上没有任何数字。比方说: from math import pi from pyx import * g = graph.graphxy(width=8) g.plot(gr
使用此方法编译pyx文件: import pyximport pyximport.install() 执行以下操作后,.pyx 文件不会重新编译和重新加载: pyximport.install() i
我一直在尝试使用 PyX 将太阳的天文符号放在图表上,但没有成功。我的代码如下: from pyx import * from pylab import * x=arange(1,5,0.1)
这个问题在这里已经有了答案: Collapse multiple submodules to one Cython extension (5 个答案) 关闭 2 年前。 我有多个 .pyx 文件,有
我正在尝试在 Python 中的 PyX 模块中运行。 这是一个名为“mplot.py”的简单程序: from pyx import * g = graph.graphxy(width=8) g
我在 cython 中得到了代表 2 个类的 3 个文件: 1. ../src/cython/class1.pyx 2. ../src/cython/class1.pxd 3. ../src/cyth
在我手中,我有一个 .pyc,而不是相应的 .py 或 .pyx。 是否可以对 .pyc 进行 cythonize ? 是否应该先解压为.py,如何解压? 最佳答案 Cython 是 Python 的
我有一组 UTF-8 字符,我想将其插入 PyX 生成的 pdf 文件中。我已将 # -*-coding: utf-8 -*- 添加到文件顶部。代码有点类似于以下内容: # -*- coding: u
我正在尝试从我的 python 源文件创建一个 unix 可执行文件。 我有两个文件,p1.py和p2.py p1.py:- from p2 import test_func print (test_
我正在尝试在 python 3.6 中使用 scapy 来解析 pcap 文件,我正在尝试使用的功能之一是 pdfdump。 from scapy.all import * packets = rdp
pip 知道 pyx 包: $ pip search pyx PyX - Python package for the generation of PostScript and PDF files 尝
我是一名优秀的程序员,十分优秀!