我正在debian/jessie框中运行这段代码:
from elaphe import barcode
text = 'hello world in barcode'
bc = barcode('pdf417', text, options = dict(
compact = False, eclevel = 5, columns = 13,
rowmult = 2, rows = 3),
margin=20, scale=1)运行此操作后,我将执行以下操作:
bc.save('filename.png')然后得到以下错误:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.7/dist-packages/PIL/Image.py", line 1653, in save
self.load()
File "/usr/lib/python2.7/dist-packages/PIL/EpsImagePlugin.py", line 336, in load
self.im = Ghostscript(self.tile, self.size, self.fp, scale)
File "/usr/lib/python2.7/dist-packages/PIL/EpsImagePlugin.py", line 143, in Ghostscript
stdout=subprocess.PIPE)
File "/usr/lib/python2.7/subprocess.py", line 710, in __init__
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1335, in _execute_child raise child_exception OSError: [Errno 2]
No such file or directory如果我在一个ubuntu14.04框中运行相同的代码,就没有这样的错误,并且工作正常。由于我在几个帖子中看到了这个错误,并且有了很多包,我可以得出这样的结论:它与debian有关,而不是与代码本身有关,甚至与相关联的python包也不相关。如果有某种路径来重新定义或符号链接,或者是否存在这样的修补程序,这将是可取的。
请帮帮忙。
发布于 2016-05-04 08:56:48
错误信息不是超级干净的。但这可能是由于缺少幽灵脚本包造成的。
尝试: sudo apt-获取安装鬼脚本
https://stackoverflow.com/questions/36994116
复制相似问题