Skip to content

Commit 69b627b

Browse files
committed
matplotlibrc path search fix
1 parent 24f0d9c commit 69b627b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/matplotlib/__init__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -635,9 +635,12 @@ def _get_data_path():
635635

636636
_file = _decode_filesystem_path(__file__)
637637
path = os.sep.join([os.path.dirname(_file), 'mpl-data'])
638+
path = '/usr/share/matplotlib/mpl-data'
638639
if os.path.isdir(path):
639640
return path
640641

642+
raise RuntimeError('Could not find the matplotlib data files')
643+
641644
# setuptools' namespace_packages may highjack this init file
642645
# so need to try something known to be in matplotlib, not basemap
643646
import matplotlib.afm
@@ -731,7 +734,7 @@ def gen_candidates():
731734
yield matplotlibrc
732735
yield os.path.join(matplotlibrc, 'matplotlibrc')
733736
yield os.path.join(_get_configdir(), 'matplotlibrc')
734-
yield os.path.join(get_data_path(), 'matplotlibrc')
737+
yield '/etc/matplotlibrc'
735738

736739
for fname in gen_candidates():
737740
if os.path.isfile(fname):

0 commit comments

Comments
 (0)