2011-07-27 2 views
2

실행하려고 안녕하세요 세계 예를파이썬 고스트 : RuntimeError에 : 고스트 스크립트 라이브러리 (libgs를) 찾을 수 없습니다

import sys 
import ghostscript 

args = [ 
    "ps2pdf", # actual value doesn't matter 
    "-dNOPAUSE", "-dBATCH", "-dSAFER", 
    "-sDEVICE=pdfwrite", 
    "-sOutputFile=" + sys.argv[1], 
    "-c", ".setpdfwrite", 
    "-f", sys.argv[2] 
    ] 

ghostscript.Ghostscript(*args) 

점점 오류시 :

File "/Users/ddd/sss/ddd/eee.py", line 2, in <module> 
    import ghostscript 
    File "build/bdist.macosx-10.6-universal/egg/ghostscript/__init__.py", line 33, in <module> 

    File "build/bdist.macosx-10.6-universal/egg/ghostscript/_gsprint.py", line 290, in <module> 
RuntimeError: Can not find Ghostscript library (libgs) 

무엇인지는이 라이브러리를 libgs하고 어떻게 할 수 알 겠어?

은 BTW 난 당신이 Ghostscript's official download site에서뿐만 아니라 their documentation에보고해야 맥

답변

1

에있어. 이하지 않는 경우

당신은 당신이 직접 IRC 서버 irc.freenode.net에 #ghostscript 라는 이름의 온라인 채팅 채널에서 GS 개발자 질문을 할 수 시작했다. 그들은 매우 친절하고 유익한 사람들입니다.

1

해결하려면 사이트 패키지의 고스트 스크립트 모듈 경로를 수정해야합니다.

는 _gsprint.py에서 이런 식으로 수정하여 libgs 파일의 위치를 ​​

libgs = ctypes.util.find_library('/opt/local/lib/libgs')

합니다. 하지만이 가지 않았다 - 아마 이러한 DMGs도 작동

brew install ghostscript 

:

pip install ghostscript 

아니라 C 부품 : 나를 위해

관련 문제