首页 > 解决方案 > 模块“matplotlib”在 Django 中没有属性“switch_backend”

问题描述

我一直在网上搜索没有成功。我将 matplotlib 导入到我的 django 3.2 项目中,我得到错误模块 'matplotlib' has no attribute 'switch_backend'

import matplotlib as plt

plt.switch_backend('AGG')
fig = plt.figure(figsize=(10, 4))

有没有办法解决这个问题?

标签: pythonmatplotlib

解决方案


推荐阅读