Python:PyNomo 示例的断管错误(在 Nomographer 函数中)

Posted

技术标签:

【中文标题】Python:PyNomo 示例的断管错误(在 Nomographer 函数中)【英文标题】:Python: Broken Pipe Error For PyNomo Example (in function Nomographer) 【发布时间】:2016-07-07 20:19:55 【问题描述】:

我在Python 2.7 上使用pycharm。我已经安装了PyNomo。我正在尝试运行此small example from the official site。代码在链接上可用,我只是复制粘贴它。我收到以下错误:

Aligning with tag A
Traceback (most recent call last):
  File "/home/darshil/Desktop/Caltech Summer Internship/Radiation Ononcology Data/DB/rad3/pynomo_temp.py", line 71, in <module>
    Nomographer(main_params)
  File "/usr/local/lib/python2.7/dist-packages/pynomo/nomographer.py", line 203, in __init__
    wrapper.draw_nomogram(c,params['post_func'])
  File "/usr/local/lib/python2.7/dist-packages/pynomo/nomo_wrapper.py", line 213, in draw_nomogram
    block.draw(canvas)
  File "/usr/local/lib/python2.7/dist-packages/pynomo/nomo_wrapper.py", line 445, in draw
    atom.draw(canvas)
  File "/usr/local/lib/python2.7/dist-packages/pynomo/nomo_wrapper.py", line 2503, in draw
    axis_appear=p,base_start=base_start,base_stop=base_stop)
  File "/usr/local/lib/python2.7/dist-packages/pynomo/nomo_axis.py", line 123, in __init__
    self.draw_axis(canvas)
  File "/usr/local/lib/python2.7/dist-packages/pynomo/nomo_axis.py", line 1067, in draw_axis
    c.text(x,y,ttext,attr+[text_color])
  File "/usr/local/lib/python2.7/dist-packages/pyx/canvas.py", line 324, in text
    return self.insert(self.texrunner.text(x, y, atext, *args, **kwargs))
  File "/usr/local/lib/python2.7/dist-packages/pyx/text.py", line 1194, in text
    self.execute(expr, self.defaulttexmessagesdefaultrun + self.texmessagesdefaultrun + texmessages)
  File "/usr/local/lib/python2.7/dist-packages/pyx/text.py", line 951, in execute
    self.defaulttexmessagesstart + self.texmessagesstart)
  File "/usr/local/lib/python2.7/dist-packages/pyx/text.py", line 1005, in execute
    self.texinput.write(self.expr)
IOError: [Errno 32] Broken pipe
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
  File "/usr/lib/python2.7/atexit.py", line 24, in _run_exitfuncs
    func(*targs, **kargs)
  File "/usr/local/lib/python2.7/dist-packages/pyx/text.py", line 748, in _cleantmp
    texrunner.texinput.write("\n\\end\n")
IOError: [Errno 32] Broken pipe
Error in sys.exitfunc:
Traceback (most recent call last):
  File "/usr/lib/python2.7/atexit.py", line 24, in _run_exitfuncs
    func(*targs, **kargs)
  File "/usr/local/lib/python2.7/dist-packages/pyx/text.py", line 748, in _cleantmp
    texrunner.texinput.write("\n\\end\n")
IOError: [Errno 32] Broken pipe

Process finished with exit code 1

错误在代码的最后一行:

Nomographer(main_params)

我查看了其他有关“管道损坏错误”的问题:here、here 和 here。但它们都对我没有帮助。

任何关于如何解决的指示都会非常有帮助。

【问题讨论】:

PyNomo 使用 TeX 安装来排版文本。也许这是丢失导致管道破裂。您需要能够在命令行tex hello.tex 上运行内容为Hello, world!\bye 的文件hello.tex。它应该产生一个文件hello.dvi。如果没有,你需要安装一个 TeX 发行版,比如 TeXLive。 成功了!你能把它放在答案中,以便我将其标记为正确吗?谢谢! 【参考方案1】:

PyNomo 使用 TeX 安装来排版文本。也许这是丢失导致管道破裂。您需要能够在命令行tex hello.tex 上运行内容为Hello, world!\bye 的文件hello.tex。它应该产生一个文件hello.dvi。如果没有,您需要安装 TeX 发行版,例如 TeXLive。

【讨论】:

以上是关于Python:PyNomo 示例的断管错误(在 Nomographer 函数中)的主要内容,如果未能解决你的问题,请参考以下文章

在 Python 2 和 Python 3 中捕获断管

Adwords API 并行报错(多处理断管)

使用 selenium 运行 django-test 时出现断管错误

哈德森:“是的:标准输出:断管”

JDBC 断管 Mac

Nginx 调试 Django 时出现“断管”?