V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
tyy123
V2EX  ›  Python

nuikta 打包 exe 运行出现的 comtypes ImportError: Typelib different than module 问题

  •  
  •   tyy123 · 16 天前 · 746 次点击

    我用 nuikta 打包成 exe 工具,因为要用到 comtypes 的原因,加上了--include-package=comtypes --include-package=comtypes.client --include-package=comtypes.gen ,打包成的 exe 工具在本地运行可以,但是在一个全新机器上就会出现 omtypes\gen_944DE083_8FB8_45CF_BCB7_C477ACB2F897_0_1_0.py", line 9204, in <module> \comtypes_tlib_version_checker.py", line 18, in _check_version ImportError: Typelib different than module ,然后我在代码里指定了 comtypes.gen_dir = COMTYPES_GEN_DIR ,还是不行,有没有大佬遇到过这种情况,求指教

    2 条回复    2025-06-04 16:39:31 +08:00
    ciderzero
        1
    ciderzero  
       5 天前
    换一个 comtypes 版本试试
    tyy123
        2
    tyy123  
    OP
       1 天前
    确实换了低版本得 python 和 comtypes 就可以了。。。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   5584 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 06:33 · PVG 14:33 · LAX 23:33 · JFK 02:33
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.