From: Ralf G. <ral...@go...> - 2007-10-31 01:33:57
|
Hi all, I just installed mpl on ubuntu gutsy, and got errors after setting text.usetex : True and ps.usedistiller : ghostscript. The problem seems to be in checkdep_ghostscript() in __init__.py, specifically the command 'gs -v' (should be replaced by 'gs --version'). For my system I get: $ gs -v GPL Ghostscript SVN PRE-RELEASE 8.61 (2007-08-02) Copyright (C) 2007 Artifex Software, Inc. All rights reserved. and: $ gs --version 8.61 Below I give a modified version of checkdep_ghostscript() that should work for all version of ghostscript. Cheers, Ralf def checkdep_ghostscript(): try: if sys.platform == 'win32': command = 'gswin32c -v' else: command = 'gs --version' stdin, stdout = os.popen4(command) line = stdout.readlines()[0] vtest = '.'.join(line.split('.')[:2]) # deal with version numbers like ' 7.07.1' float(vtest) return vtest except (IndexError, ValueError): return None |