首页 > 解决方案 > VSCode:_argtypes_中的TypeError第2项按值传递联合,不支持

问题描述

我得到了上面的例外。谁能帮我找出原因。这是我的代码:

import pyttsx3  # pip install pyttsx3

engine = pyttsx3.init() # creating a variable named engine
#engine.say('Hello World...!') #calling that function
#engine.runAndWait() #it is also a pre build funtion used to run and wait till funtion is completed

标签: pythonvisual-studio-code

解决方案


当我使用 " pip install pyttsx3" 安装模块pyttsx3时,我遇到了你描述的情况:

在此处输入图像描述

我在pip列表中看到默认安装pyttsx3的是2.90版本,所以我使用“”安装了2.71版本的pyttsx3 pip install pyttsx3==2.71。调试完代码,听到声音:“Hello World!”。

控制台的调试结果:

在此处输入图像描述

我使用的 Python 版本:Python3.7.6 和 Python3.8.3。他们都可以运行上面的代码。


推荐阅读