开发者

Use py2app with Matplotlib and its Tex formatting? Dvipng not found

I have an application put together in py2app on OS X 10.6 which uses Matplotlib to generate graphs. (Using py2app version 0.5.3 and matplotlib version 0.99.3, if it matters.) I have the Tex formatting option enabled:

...
from matplotlib import rc
rc('text', usetex=True)
...

The script works fine when executed in the command line, including the Tex formatting. The 开发者_运维知识库application is created with py2app:

py2applet --make-setup MyApplication.py
python setup.py py2app

There are no errors in creating or opening the application. However, when I try to generate a plot in the application, I get the error:

RuntimeError: Could not obtain dvipng version

Is it because py2app is not including dvipng in the application itself? What's the best way to go about fixing this?


By adding:

OPTIONS = {'argv_emulation': True, 'packages':['matplotlib']}

to my setup.py, I get this to work correctly when the application is opened from the command line. Strangely though, when opened by another means (double clicking in the applications folder, for example) I have the same problems I started with. Still looking for a full fix.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜