0
我一直试图在OS X 10.9上以pgf模式使用matplotlib,但是我遇到了一个问题,当库被库调用时xelatex没有找到(我已经完全安装了texlive路径)。访问Python中的系统路径
我做了一些挖掘:
from subprocess import call
call("source .bash_profile", shell=True) #I tried this as a python console startup script to see if I could get it to update the PATH.
print("Current bin path:")
call("echo $PATH", shell=True)
产量
Current bin path:
/usr/bin:/bin:/usr/sbin:/sbin
而在终端 '回声$ PATH' 给出
/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin:/usr/texbin
我怎样才能得到蟒蛇看到xelatex为这应该。 Matplotlib说xelatex需要在PATH上可用 - 根据它是哪个xelatex。
作为一个临时的解决办法,我有
ln -s /usr/texbin/xelatex /usr/bin/xelatex
,这给出了一个临时的解决方案,但还远远没有坚实的长期,如果我需要其他二进制文件被调用。
非常感谢您的任何想法。
编辑:扬的评论让我记得系统范围的路径和配置文件设置的路径之间的差异。我编辑/ etc /路径来包含/ usr/texbin,这也没有帮助。
如果是我的程序,我会通过它的绝对位置调用xelatex,但我宁可不要乱用marplotlib的src,除非必须。现在我将继续使用符号链接,但如果任何人有更优雅的解决方案,请在此发布。
查看编辑中的更新。 – Goobley