[英]ImportError: cannot import name 'styles' from 'matplotlib'
The issue is in the title:问题在标题中:
ImportError: cannot import name 'styles' from 'matplotlib'
I have tried the recommended answers, I have used我试过推荐的答案,我用过
sudo pip install --upgrade matplotlib
and和
pip install --user --upgrade matplotlib
and still have the same error as before.并且仍然有与以前相同的错误。
Code:代码:
import tkinter as tk
from tkinter import ttk
import matplotlib
from matplotlib import styles
LARGE_FONT = ("Verdana", 12)
error:错误:
ImportError: cannot import name 'styles' from 'matplotlib'
(/Users/myname/opt/anaconda3/lib/python3.7/site-packages/matplotlib/__init__.py)
I have tried this with a few python versions in vs code (3.6.6, 3.7.6, 3.8.1) and Anaconda Spyder (which I believe is 3.7.x but I'm not sure which) and get the same error.我已经在 vs 代码(3.6.6、3.7.6、3.8.1)和 Anaconda Spyder(我相信是 3.7.x 但我不确定是哪个)中尝试了几个 python 版本并得到了同样的错误。
Any ideas or is Matplotlib styles not useable anymore?有什么想法或者 Matplotlib styles 不再可用了吗?
Do you mean 'style' instead of 'styles'?你的意思是“风格”而不是“风格”?
from matplotlib import style
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.