Python:破管错误PyNomo示例(函数Nomographer)
问题描述:
我在Python 2.7
上使用pycharm
。我已安装PyNomo
。我试图运行这个small example from the official site。代码在链接上可用,我只是简单地复制粘贴它。我收到以下错误:Python:破管错误PyNomo示例(函数Nomographer)
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
。如果没有,你需要安装一个像TeXLive这样的TeX发行版。
PyNomo使用TeX安装来排版文本。也许这是缺少导致管道破损。您需要能够在命令行'tex hello.tex'上运行内容为'Hello,world!\ bye'的文件'hello.tex'。它应该产生一个文件'hello.dvi'。如果没有,你需要安装一个像TeXLive这样的TeX发行版。 – wobsta
工作正常!你可以把它放在答案中,所以我可以将其标记为正确的?谢谢! –