python的pyttxs出现问题

在尝试使用Python的pyttsx3库进行文本转语音时,遇到了'KeyError: None'和'ImportError: cannot import name 'SpeechLib''的错误。问题可能与电脑配置有关,尤其是对于华为Win10系统的兼容性。错误源于comtypes模块在导入SpeechLib时失败,进一步导致ctypes模块的异常。
摘要由CSDN通过智能技术生成

源代码
import pyttsx3

engine = pyttsx3.init()

engine.say(‘Sally sells seashells by the seashore.’)
engine.say(‘The quick brown fox jumped over the lazy dog.’)

engine.runAndWait()

好像别人的电脑能运行成功但是我的运行不了 不知道是不是电脑的问题 我的电脑是华为 win10
===================== RESTART: C:\Users\cai\Desktop\ss1.py =====================
Traceback (most recent call last):
File “D:\Python\lib\site-packages\pyttsx3_init_.py”, line 20, in init
eng = _activeEngines[driverName]
File “D:\Python\lib\weakref.py”, line 137, in getitem
o = self.datakey
KeyError: None

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “D:\Python\lib\si

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值