亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

PyCharm使用matplotlib報(bào)MatplotlibDeprecationWarning問題解決辦法

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

問題描述:

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

報(bào)錯(cuò)截圖如下所示:

代碼示例:

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庫(kù)

查看matplotlib庫(kù)版本信息

問題解決

安裝低版本matplotlib即可

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

應(yīng)該安裝該版本:

卸載不匹配的版本:

安裝時(shí)matplotlib版本

問題驗(yàn)證:

重新運(yùn)行:

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

總結(jié)

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

相關(guān)文章

最新評(píng)論