Pyttsx:AttributeError:'模块'对象没有属性'init' [英] Pyttsx: AttributeError: 'module' object has no attribute 'init'

查看:167
本文介绍了Pyttsx:AttributeError:'模块'对象没有属性'init'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,谢谢!

import pyttsx
engine = pyttsx.init()
engine.say('Hello World')
engine.runAndWait()

我收到此错误:

Traceback (most recent call last):
  File "C:\Users\xxx\eclipse\workspace\Ai_Project\AI\Ai_Brain.py", line 8, in <module>
    engine = pyttsx.init()
AttributeError: 'module' object has no attribute 'init'

我在Windows 7上使用Python 2.7和eclipse neon.这是某种兼容性问题吗?我已经搜索了很多相关问题,但是在我的案例中应用答案并不能解决错误

I am on Windows 7 using Python 2.7 and eclipse neon. Is this some kind of compatibility issue? I have searched a lot of related questions but applying the answers on my case didn't fix the error

推荐答案

我想很容易,我发布了答案,以防将来有人遇到相同的问题并且他/她进行的每个查询都行不通.将此视为人为错误,并检查您的兼容性问题.就我而言,问题是我安装了pywin32-219.win- amd64 -py2.7.而不是pywin32-py2.7.exe.

Fairly easy i guess and i post the answer in case someone in future has the same problem and every query he/she made didn't work. Consider this a human error and check your compatibility issues. In my case problem was that instead of pywin32-py2.7.exe i installed pywin32-219.win-amd64-py2.7.

感谢所有阅读或回答我的问题的人

Thanks to everyone who read or answered my question

这篇关于Pyttsx:AttributeError:'模块'对象没有属性'init'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆