我正在使用Python 3.6。我已经通过命令
安装了模块comtypes
python -m pip install comtypes
Requirement already satisfied: comtypes in c:\users\singtech\appdata\local\programs\python\python36-32\lib\site-packages
但我仍然从我的脚本中获取comtypes的导入错误:
import comtypes.client as cc
import comtypes
mylib = cc.GetModule("d:\\path\\to\\mylib.dll")
print(mylib)
运行脚本时,会产生以下错误:
Traceback (most recent call last):
File "D:\python-apps\aos.py", line 1, in <module>
import comtypes.client as cc
ImportError: No module named 'comtypes'