0

I would like to return audio using os.system because, in PyCharm, it returns the error:

"Traceback (most recent call last): File "/Users/Milo/Desktop/python/Joe.py", line 5, in import pyttsx File "/private/var/folders/z_/wpk6crsn2slfh_1y5hytwsvr0000gp/T/Joe.py/venv/lib/python3.6/site-packages/pyttsx/init.py", line 18, in from engine import Engine ModuleNotFoundError: No module named 'engine'".

For example:

import pyttsx
engine = pyttsx.init()
engine.say('This is a test')
engine.runAndWait()
'''Somehow play sound/voice'''

Am I using the wrong pyttsx module? Did I install it wrong? I am using python 3.6.4 and am using Mac OSX. I highly prefer that if I need a new module, it works with NSSpeechSynthesizer. Should I just run it via terminal? However, I would like to use it with PyCharm. Let me know if there if there is any info you need to know the I did not disclose.

Thanks.

user9311010
  • 79
  • 11
  • Please add the full error traceback to your question. – Klaus D. Feb 09 '18 at 04:06
  • Is OS X you can use the say command in the terminal `say "hello"` – Chris Feb 09 '18 at 04:18
  • Is the module available in the interpreter assigned to the project in PyCharm? – Joe Feb 09 '18 at 08:36
  • "Is OS X you can use the say command in the terminal say "hello" – Chris" This worked! Thanks! Please post this as an answer. – user9311010 Feb 09 '18 at 14:26
  • Possible duplicate of [While Mac OSX has the say command to speak, or so to say, is there any command that is similar for Python?](https://stackoverflow.com/questions/38387676/while-mac-osx-has-the-say-command-to-speak-or-so-to-say-is-there-any-command-t) – Anil_M Feb 11 '18 at 01:46

0 Answers0