0

我正在尝试在 Mac 上设置 elaphe。当我尝试使用终端生成一些条形码时,使用命令python + /.../file.pyelaphe 可以正常工作并正确生成条形码。但是当我尝试通过 web (php)执行时,我在 Apache 的错误日志中收到以下错误:

Traceback (most recent call last):
  File "lib/barcode_generator/generator.py", line 19, in <module>
    code_39_image.save(str(random)+'.tif')
  File "/Users/x/Library/Python/2.7/lib/python/site-packages/PIL/Image.py", line 1406, in save
    self.load()
  File "/Users/x/Library/Python/2.7/lib/python/site-packages/PIL/EpsImagePlugin.py", line 283, in load
    self.im = Ghostscript(self.tile, self.size, self.fp)
  **File "/Users/x/Library/Python/2.7/lib/python/site-packages/PIL/EpsImagePlugin.py", line 72, in Ghostscript
    gs.write(s)**

如果我在 Windows 中,我会说这是路径问题,程序找不到“gs.write”,但在 Mac 中我是菜鸟,我不知道是否相同,但我已经包含了这两条路径:

export PATH=/Users/x/Library/Python/2.7/bin:$PATH
export PATH=/usr/local/bin:$PATH

我很感激能就这个错误给出一些想法。提前致谢。

4

1 回答 1

0

Fixed via a symbolic link. Clearly was a PATH issue or hardcoded reference to the gs binary.

sudo ln -s /usr/local/bin/gs /usr/bin/gs

于 2013-04-20T20:43:33.083 回答