pipenv wxpython 解决ImportError: Typelib different than module
作者:互联网
在pipenv环境下安装wxpython后,引入wx.lib.activex时报错了:ImportError: Typelib different than module
原因是comtypes动态生成脚本及检查版本出错了
参考: https://github.com/enthought/comtypes/issues/231
解决方案:
pipenv uninstall -y comtypes
pipenv install install https://github.com/vasily-v-ryabov/comtypes/archive/refs/heads/mtime_none.zip
python /python安装目录/Scripts/clear_comtypes_cache.py
然后第一次import wx.lib.activex后会报错,应该是临时生成的脚本还没生成,再次导入就成功了
标签:different,pipenv,ImportError,module,wxpython,comtypes 来源: https://blog.csdn.net/hbh112233abc/article/details/120523644