简体   繁体   English

ModuleNotFoundError:运行 pyttsx 时没有名为“engine”的模块

[英]ModuleNotFoundError: No module named 'engine' while running pyttsx

When I run this code I always get this error: ModuleNotFoundError: No module named 'engine' .当我运行此代码时,我总是收到此错误: ModuleNotFoundError: No module named 'engine'

import pyttsx

engine = pyttsx.init()
engine.say('hello world')

Does anyone know why this is happening and how to fix it?有谁知道为什么会发生这种情况以及如何解决?

Use pyttsx3 package instead that supports both python 2 and 3. You can install it for example with pip install pyttsx3 on your system.使用pyttsx3 package 而不是同时支持 python 2 和 3。例如,您可以使用pip install pyttsx3来安装它。

import pyttsx3

engine = pyttsx3.init()
engine.say("hello world")
engine.runAndWait()

you have to use import pyttsx3你必须使用import pyttsx3

The Python "ModuleNotFoundError: No module named 'click'" occurs when we forget to install the click module before importing it or install it in an incorrect environment. Python "ModuleNotFoundError: No module named 'click'" 当我们在导入之前忘记安装 click 模块或将其安装在不正确的环境中时会发生。 To solve the error, install the module by running the pip install click command.要解决该错误,请运行 pip install click 命令安装模块。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Pyttsx文本到语音-ModuleNotFoundError:没有名为“ engine”的模块 - Pyttsx text to speech - ModuleNotFoundError: No module named 'engine' ModuleNotFoundError:没有名为“pyttsx3”的模块 - ModuleNotFoundError: No module named 'pyttsx3' pyttsx错误:没有名为“ engine”的模块 - pyttsx error: No module named 'engine' ModuleNotFoundError:没有名为“pyttsx3.drivers”的模块 - ModuleNotFoundError: No module named 'pyttsx3.drivers' Python 3.8 错误:ModuleNotFoundError:没有名为“pyttsx3”的模块 - Python 3.8 error: ModuleNotFoundError: No module named 'pyttsx3' ModuleNotFoundError:即使在下载库后也没有名为“pyttsx3”的模块 - ModuleNotFoundError: No module named 'pyttsx3' even after downloading the library ModuleNotFoundError:运行 Django + Docker 项目时没有名为“djoser”的模块 - ModuleNotFoundError: No module named 'djoser' while running Django + Docker project 错误为:-ModuleNotFoundError: No module named 'pyspark' While running Pyspark in docker - Error as:-ModuleNotFoundError: No module named ‘pyspark’ While running Pyspark in docker ModuleNotFoundError:在虚拟环境中运行服务器时没有名为“django”的模块 - ModuleNotFoundError: No module named 'django' while running server in virtual environment 运行 celery worker 时出错:ModuleNotFoundError:没有名为“mysite”的模块 - Error while running celery worker : ModuleNotFoundError: No module named 'mysite'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM