From: Alexander H. <mat...@2s...> - 2013-10-10 22:04:30
|
I am using Fedora 19, 64 bit, and the distribution's python 3.3.2, and the most recent version of mpl from git there seems to be a bug in the starup routine where proper conversion from bytes to string (as needed for Python 3) is not done the problem is in /matplotlib/__init__.py, line 459 ... 460 459 gs_exec, gs_v = checkdep_ghostscript() 460 if compare_versions(gs_v, gs_sugg): pass ipdb> gs_exec, gs_v ('gs', b'9.07') where clearly gs_v needs to be str Could you please make checkdep_ghostscript() to be python3-save by changing line 334 from v = stdout[:-1] to v = stdout[:-1].decode('ascii') (my apologies not following the bug report procedures; I hope you can consider it anyway) -Alexander ~/python/source3>ip Python 3.3.2 (default, Aug 23 2013, 19:00:04) Type "copyright", "credits" or "license" for more information. IPython 0.13.2 -- An enhanced Interactive Python. ? -> Introduction and overview of IPython's features. %quickref -> Quick reference. help -> Python's own help system. object? -> Details about 'object', use 'object??' for extra details. [TerminalIPythonApp] GUI event loop or pylab initialization failed --------------------------------------------------------------------------- TypeError Traceback (most recent call last) /usr/lib/python3.3/site-packages/IPython/core/pylabtools.py in find_gui_and_backend(gui) 194 """ 195 --> 196 import matplotlib 197 198 if gui and gui != 'auto': /home/alex/mpl/usr/lib64/python3.3/site-packages/matplotlib/__init__.py in <module>() 975 976 rcParams['ps.usedistiller'] = checkdep_ps_distiller(rcParams['ps.usedistiller']) --> 977 rcParams['text.usetex'] = checkdep_usetex(rcParams['text.usetex']) 978 979 if rcParams['axes.formatter.use_locale']: /home/alex/mpl/usr/lib64/python3.3/site-packages/matplotlib/__init__.py in checkdep_usetex(s) 458 459 gs_exec, gs_v = checkdep_ghostscript() --> 460 if compare_versions(gs_v, gs_sugg): pass 461 elif compare_versions(gs_v, gs_req): 462 verbose.report(('ghostscript-%s found. ghostscript-%s or later is ' /home/alex/mpl/usr/lib64/python3.3/site-packages/matplotlib/__init__.py in compare_versions(a, b) 116 "return True if a is greater than or equal to b" 117 if a: --> 118 a = distutils.version.LooseVersion(a) 119 b = distutils.version.LooseVersion(b) 120 if a>=b: return True /usr/lib64/python3.3/distutils/version.py in __init__(self, vstring) 308 def __init__ (self, vstring=None): 309 if vstring: --> 310 self.parse(vstring) 311 312 /usr/lib64/python3.3/distutils/version.py in parse(self, vstring) 316 # use by __str__ 317 self.vstring = vstring --> 318 components = [x for x in self.component_re.split(vstring) 319 if x and x != '.'] 320 for i, obj in enumerate(components): TypeError: can't use a string pattern on a bytes-like object |