@@ -428,11 +428,16 @@ def _get_data_path():
428428
429429 # py2exe zips pure python, so still need special check
430430 if getattr (sys ,'frozen' ,None ):
431- path = os .path .join (os .path .split (sys .path [0 ])[0 ], 'matplotlibdata' )
431+ path = os .path .join (os .path .split (sys .path [0 ])[0 ], 'mpl-data' )
432+ if os .path .isdir (path ): return path
433+ else :
434+ # Try again assuming we need to step up one more directory
435+ path = os .path .join (os .path .split (os .path .split (sys .path [0 ])[0 ])[0 ],
436+ 'mpl-data' )
432437 if os .path .isdir (path ): return path
433438 else :
434439 # Try again assuming sys.path[0] is a dir not a exe
435- path = os .path .join (sys .path [0 ], 'matplotlibdata ' )
440+ path = os .path .join (sys .path [0 ], 'mpl-data ' )
436441 if os .path .isdir (path ): return path
437442
438443 raise RuntimeError ('Could not find the matplotlib data files' )
@@ -442,7 +447,8 @@ def _get_data_path_cached():
442447 defaultParams ['datapath' ][0 ] = _get_data_path ()
443448 return defaultParams ['datapath' ][0 ]
444449
445- get_data_path = verbose .wrap ('matplotlib data path %s' , _get_data_path_cached , always = False )
450+ get_data_path = verbose .wrap ('matplotlib data path %s' , _get_data_path_cached ,
451+ always = False )
446452
447453def get_py2exe_datafiles ():
448454 datapath = get_data_path ()
@@ -454,8 +460,8 @@ def get_py2exe_datafiles():
454460 if 'Matplotlib.nib' in files :
455461 files .remove ('Matplotlib.nib' )
456462 files = [os .path .join (root , filename ) for filename in files ]
457- root = root .replace (tail , 'matplotlibdata ' )
458- root = root [root .index ('matplotlibdata ' ):]
463+ root = root .replace (tail , 'mpl-data ' )
464+ root = root [root .index ('mpl-data ' ):]
459465 d [root ] = files
460466 return d .items ()
461467
0 commit comments