Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NSSpeechDriver: 'super' object has no attribute 'init' #33

Open
iuga opened this issue Aug 3, 2015 · 5 comments
Open

NSSpeechDriver: 'super' object has no attribute 'init' #33

iuga opened this issue Aug 3, 2015 · 5 comments

Comments

@iuga
Copy link

iuga commented Aug 3, 2015

Hi All !
I grab this code from the examples:

import pyttsx
engine = pyttsx.init()
engine.say('How are you today?')
engine.runAndWait()

but is failing with a:

Traceback (most recent call last):
  File "run.py", line 2, in <module>
    engine = pyttsx.init()
  File ".../venv/lib/python2.7/site-packages/pyttsx/__init__.py", line 39, in init
    eng = Engine(driverName, debug)
  File ".../venv/lib/python2.7/site-packages/pyttsx/engine.py", line 45, in __init__
    self.proxy = driver.DriverProxy(weakref.proxy(self), driverName, debug)
  File ".../venv/lib/python2.7/site-packages/pyttsx/driver.py", line 66, in __init__
    self._driver = self._module.buildDriver(weakref.proxy(self))
  File ".../venv/lib/python2.7/site-packages/pyttsx/drivers/nsss.py", line 24, in buildDriver
    return NSSpeechDriver.alloc().initWithProxy(proxy)
  File ".../venv/lib/python2.7/site-packages/pyttsx/drivers/nsss.py", line 28, in initWithProxy
    self = super(NSSpeechDriver, self).init()
AttributeError: 'super' object has no attribute 'init'

Running it on:

OSX Yosemite 10.10.3
Python 2.7.6
pyobjc==3.0.4
pyobjc-core==3.0.4
pyttsx==1.1

Any thoughts ? Any help will be really appreciated !

@uranusjr
Copy link

It seems like that this is a problem in PyObjC. I raised this problem and was offered a solution.

This problem does not exist with the pyobjc and Python shipped with OS X, so it is either a problem with PyObjC 3.x, or a non-built-in Python installation. Unfortunately I am not able to build PyObjC on 10.10 to verify either.

@ghost
Copy link

ghost commented Aug 18, 2015

Hi uranusjr, thanks for the above solution, I can confirm it works on homebrew Python 2.7.9

@anshtyagi0
Copy link

Having same issue Python 3.11.3 installed using arch -x86_64 brew

@anshtyagi0
Copy link

@uranusjr

@usersina
Copy link

Same issue with python 3.11.5 on Ventura 13.5.1 (22G90)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants