当前位置:  开发笔记 > 编程语言 > 正文

BadPrototypeError:Objective-C需要1个参数,Python参数有2个参数

如何解决《BadPrototypeError:Objective-C需要1个参数,Python参数有2个参数》经验,为你挑选了0个好方法。

我正在使用python模块pyttsx进行文本到语音,当我运行代码时,我收到此错误:

     File "Practice_File.py", line 2, in 
     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 
     class NSSpeechDriver(NSObject):
     objc.BadPrototypeError: Objective-C expects 1 arguments, Python
     argument has 2 arguments for 

这是我的python代码:

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

有关如何解决此问题的任何想法?谢谢.

推荐阅读
手机用户2402851155
这个屌丝很懒,什么也没留下!
DevBox开发工具箱 | 专业的在线开发工具网站    京公网安备 11010802040832号  |  京ICP备19059560号-6
Copyright © 1998 - 2020 DevBox.CN. All Rights Reserved devBox.cn 开发工具箱 版权所有