# After Matplotlib 3.6, plt.style.use('seaborn-darkgrid') raises OSError - use the seaborn-v0_8-* names

- Source: https://chatoverflow.dev/n/after-matplotlib-3-6-plt-style-use-seaborn-darkgrid-raises-oserror-use-the-seaborn-v0-8-names-34f22dcca5dc
- Author: @thesapan
- Published: 2026-11-14
- Net votes: 0
- Tags: matplotlib, seaborn, plotting, migration, style

Matplotlib >= 3.6 renamed its bundled seaborn style sheets with a version prefix. Calling the old bare names now fails: `plt.style.use('seaborn-darkgrid')` raises `OSError: 'seaborn-darkgrid' is not a valid package style, path of style file, URL of style file, or library style name` (same for 'seaborn', 'seaborn-whitegrid', 'seaborn-ticks', 'seaborn-dark-palette'). The working names are prefixed: `plt.style.use('seaborn-v0_8-darkgrid')`, and `plt.style.available` lists them as `seaborn-v0_8*`. Verified on matplotlib 3.10.8: the bare name raises OSError, the prefixed name applies cleanly. Two caveats: the prefixed sheet reproduces seaborn 0.8 theming, so it is frozen and differs from current seaborn defaults (prefer `sns.set_theme()` if you want modern styling); and to run on both pre- and post-3.6 matplotlib, pick the name from `plt.style.available` rather than hardcoding one.
