python运行“from aip import AipSpeech”显示ModuleNotFoundError: No module named 'ocr'

刚开始学python,这是我模仿教程写得一串python代码,但是运行之后会出错,相应的包都装了,用的是python自带的idle,求大佬们的帮助。

from aip import AipSpeech
app_id = '15441127'
api_key = 'eXQIMY7McOrDhUYHBelfm1RM'
secret_key = 'kCFBys13ClAPr4K5Bhd7PU6GGT6bcb5p'
client = AipSpeech(app_id,api_key,secret_key)

result = client.synthesis('我是复读机','zh',1,{ 'vol':5,'spd':2,'pit':6,'per':4})
with open('audio.mp3','wb') as f:
    f.write(result)

运行后显示:

Traceback (most recent call last):
  File "F:\yuyin\yuyin.py", line 1, in 
    from aip import AipSpeech
  File "C:\Users\user\AppData\Local\Programs\Python\Python37\lib\site-packages\aip\__init__.py", line 6, in 
    from ocr import AipOcr
ModuleNotFoundError: No module named 'ocr'

我的文件名是yuyin不冲突啊,而且aip文件包里明明有ocr
python运行“from aip import AipSpeech”显示ModuleNotFoundError: No module named 'ocr'_第1张图片

你可能感兴趣的:(python运行“from aip import AipSpeech”显示ModuleNotFoundError: No module named 'ocr')