从zip-fi通过pip安装comtypes1.1.7后出错

2024-09-25 02:33:32 发布

您现在位置:Python中文网/ 问答频道 /正文

我下载了zip文件中的comtypes,并使用pip install comtypes-1.1.7.zip来安装它。已成功安装,但当我尝试导入模块时,显示错误消息:

>>> import comtypes
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Python367\lib\comtypes\__init__.py", line 381
except COMError, err:
               ^
SyntaxError: invalid syntax

Tags: 模块installpip文件import消息most错误
2条回答

该语法仅对Python2有效。显然,python3的代码没有完全更新。向他们的追踪器报告错误。在

博士的答案是正确的。我成功地修正了这个错误使用水蟒分布。 只需将Lib\site packages\comtypes目录的内容替换为anaconda目录的内容。在

相关问题 更多 >