Pages

Thursday, September 3, 2015

from engine import Engine ImportError: No module named 'engine' Solved

  from engine import Engine ImportError: No module named 'engine' Solved

Hello Viewers when you try to create text to speech program using python 3.4 or any python 3.x version .you have to face this error massage called
"  from engine import Engine
ImportError: No module named 'engine' "

because this libary is design for python 2 versions so we can fix the error.first you have to do go to your python folder and go to Libs folder and then go to site packages

C:\Python34\Lib\site-packages\pyttsx then pyttsx folder there is  engine.py file and driver.py files you have to change that two files

click on image to see in better

click on engine.py file and click edit
 go to line number 64 and there is "except Exception, e "then change it as "except Exception as e"
 then it will show like this then save it
 Then open Driver.py file and edit it in that file go to line number 105 and then you can see 
"except Exception, e" change it like previous one ."except Exception as e"


it will show like this now press save now you are ready to go

if you get help from this tutorial please share and comment
have a good day

2 comments:

  1. worked for me.
    also you have to Modify site_packages/pyttsx/init.py "from engine import Engine" to

    from .engine import Engine

    Modify site_packages/pyttsx/engine.py "import driver" to

    from . import driver

    ReplyDelete