Ich habe folgendes Problem:
Ein Programm erzeugt mir eine Latex-Quelldatei, hier "daxbuysellsma20.tex".
Code: Alles auswählen
reportfile = "daxbuysellsma20"
make_report(reportfile + ".tex")
Anschließend soll noch "dvipdf" daraus ein PDF erstellen.
Code: Alles auswählen
subp.call("latex " + reportfile + ".tex", shell=True)
subp.call("dvipdf " + reportfile + ".dvi", shell=True)
Code: Alles auswählen
/usr/bin:/bin:/usr/sbin:/sbin
/bin/sh: latex: command not found
Code: Alles auswählen
echo $PATH
/Library/Frameworks/Python.framework/Versions/3.2/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/opt/local/bin:/opt/local/sbin:/opt/local/bin:/opt/local/sbin:/opt/local/bin:/opt/local/sbin:/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/usr/texbin
Dann setzen wir halt die absoluten Pfade ein:
Code: Alles auswählen
subp.call("/usr/texbin/latex " + reportfile + ".tex", shell=True)
subp.call("/opt/local/bin/dvipdf " + reportfile + ".dvi", shell=True)
Code: Alles auswählen
/opt/local/bin/dvipdf: line 47: exec: dvips: not found
/opt/local/bin/dvipdf: line 47: gs: command not found
(1) Ich teile der subprocess-Shell meinen bash-Pfad mit
(2) Ich rufe eine Shell auf, die meinen System-Environment-Pfad übernimmt
Oder gibt es Möglichkeit (3)?
Das Kummerobjekt: Mac OSX Lion/Python 2.7.3
Oder ist es eine Mac-spezifische Macke?
Bitte um Hilfe!