欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

PyCharm使用matplotlib報MatplotlibDeprecationWarning問題解決辦法

 更新時間:2023年06月14日 14:54:08   作者:krislong  
這篇文章主要給大家介紹了關(guān)于PyCharm使用matplotlib報MatplotlibDeprecationWarning問題解決的相關(guān)資料,主要是 matplotlib版本過高導致的,文中通過圖文介紹的非常詳細,需要的朋友可以參考下

問題描述:

這個錯誤全部顯示為:MatplotlibDeprecationWarning: Support for FigureCanvases without a required_interactive_framework attribute was deprecated in Matplotlib 3.6 and will be removed two minor releases later.

報錯截圖如下所示:

代碼示例:

import matplotlib.pyplot as plt
import numpy as np
x = np.arange(0, 10, 0.1)
y = np.sin(x)
plt.plot(x, y)
plt.show()
plt.plot(x, y, ‘r', label=‘sin(x)')
plt.xlabel(‘x')
plt.ylabel(‘y')
plt.title(‘Sin Wave')
plt.legend()
plt.show()

原因定位:

使用了過高版本的matplotlib庫

查看matplotlib庫版本信息

問題解決

安裝低版本matplotlib即可

查看與當前matplotlib版本是否匹配當前python環(huán)境,可參考這個網(wǎng)址https://pypi.org/project/matplotlib/3.2.0/#history

應該安裝該版本:

卸載不匹配的版本:

安裝時matplotlib版本

問題驗證:

重新運行:

安裝合適的低版本matplotlib,問題就解決了

總結(jié)

到此這篇關(guān)于PyCharm使用matplotlib報MatplotlibDeprecationWarning問題解決辦法的文章就介紹到這了,更多相關(guān)matplotlib報MatplotlibDeprecationWarning內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!

相關(guān)文章

最新評論