BadPrototypeError: Objective-C expects 1 arguments, Python argument has 2 arguments

帅比萌擦擦* 提交于 2019-12-21 12:57:45

问题


I am working with the python module pyttsx for text to speech and when I run the code, I get this error:

     File "Practice_File.py", line 2, in <module>
     engine = pyttsx.init()
     File "/Library/Python/2.7/site-packages/pyttsx/__init__.py",
     line 39, in init
     eng = Engine(driverName, debug)
     File "/Library/Python/2.7/site-packages/pyttsx/engine.py", line
     45, in __init__
     self.proxy = driver.DriverProxy(weakref.proxy(self), driverName,
     debug)
     File "/Library/Python/2.7/site-packages/pyttsx/driver.py", line
     64, in __init__
     self._module = __import__(name, globals(), locals(), [driverName])
     File "/Library/Python/2.7/site-packages/pyttsx/drivers
     /nsss.py", line 26, in <module>
     class NSSpeechDriver(NSObject):
     objc.BadPrototypeError: Objective-C expects 1 arguments, Python
     argument has 2 arguments for <unbound selector initWithProxy of
     NSSpeechDriver at 0x107592e68>

Here is my python code:

    import pyttsx
    engine = pyttsx.init()
    engine.say('Good morning.')
    engine.runAndWait()

Any ideas on how to fix this issue? Thank you.

来源:https://stackoverflow.com/questions/41637233/badprototypeerror-objective-c-expects-1-arguments-python-argument-has-2-argume

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