ImportError: cannot import name 'styles' from 'matplotlib'

ImportError: cannot import name 'styles' from 'matplotlib'

问题在标题中:

ImportError: cannot import name 'styles' from 'matplotlib' 

我试过推荐的答案,我用过

sudo pip install --upgrade matplotlib

pip install --user --upgrade matplotlib

还是和以前一样的错误。

代码:

import tkinter as tk
from tkinter import ttk
import matplotlib
from matplotlib import styles

LARGE_FONT = ("Verdana", 12)

错误:

ImportError: cannot import name 'styles' from 'matplotlib' 
 (/Users/myname/opt/anaconda3/lib/python3.7/site-packages/matplotlib/__init__.py)

我已经在 vs 代码(3.6.6、3.7.6、3.8.1)和 Anaconda Spyder(我认为是 3.7.x 但是我不确定是哪个)并得到同样的错误。

有什么想法或者 Matplotlib 样式不再可用了吗?

你是说 'style' 而不是 'styles' 吗?

from matplotlib import style