ImportError: No Module named 'driver' in pyttsx

有些话、适合烂在心里 提交于 2019-12-05 00:29:42
fedepad

Well, the problem seems to be addressed in the following post
import pyttsx works in python 2.7, but not in python3

Can anybody enlighten me if there is any pyttsx library that is written in Python 3.X?

Yes, please use the following version:
https://github.com/jpercent/pyttsx
It is a Python3 port of pyttsx which seems to address the problems you face and targets Python 3.X versions.
For example the error you see (ImportError: No module named 'drivers') is addressed by the following commit
https://github.com/jpercent/pyttsx/commit/f035083338f39f7d93b0c610fbef0bb55fc9fc1c
which was merged in the aforementioned repository.
To install the pyttsx python module, you can

pip install git+git://github.com/jpercent/pyttsx.git

or

pip install git+https://github.com/jpercent/pyttsx.git

or

git clone https://github.com/jpercent/pyttsx.git 
cd pyttsx 
sudo python setup.py install  

or do that inside a virtual environment if you use them. You can avoid using 'sudo' to install, depends on the environment you use and how you organized the packages (locations, etc.).
Of course, use the right python (python3) and pip (pip3) as you have in your environment.
Please remove and clean the previous pyttsx package you had there in the environment.
In addition, you can visit http://pyttsx.readthedocs.io/en/latest/install.html
for more details on that.

site-packages hasn't included your PY_HOME or PATH. Please open Enviroment Variables and add it to the System Variable.

Add something like below, also you will see required packages under the folder.

C:\where_your_python_installation\Lib\site-packages

Hope it helps

You can install

pyttsx3

which is compatible with both python3 and python2 and is error free as far as i have tested.

Install:

pip install pyttsx3

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!