推荐学习书目
› 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 · May 21, 2025 · 2328 views
    This topic created in 502 days ago, the information mentioned may be changed or developed.

    我用 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 replies  •  2025-06-04 16:39:31 +08:00
    ciderzero
        1
    ciderzero  
       May 31, 2025
    换一个 comtypes 版本试试
    tyy123
        2
    tyy123  
    OP
       Jun 4, 2025
    确实换了低版本得 python 和 comtypes 就可以了。。。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2375 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 04:19 · PVG 12:19 · LAX 21:19 · JFK 00:19
    ♥ Do have faith in what you're doing.