AttributeError: module ‘pywt‘ has no attribute ‘dwt2‘

import pywt

from PIL import Image
img=Image.open('lena.jpg')
img = img.convert('L')
data=img.getdata()
cA,(cH,cV,cD)=pywt.dwt2(data, 'haar', mode='symmetric', axes=(0, 0))
print(cA)

AttributeError: module ‘pywt‘ has no attribute ‘dwt2‘_第1张图片
看到网上说要先用命令
pip unintall pywt
根本没用

后来被自己蠢哭,自己的py文件名和模块名相同了。

你可能感兴趣的:(笔记,pywt)