cx-freeze fails to include modules even when included specifically

后端 未结 2 1914
名媛妹妹
名媛妹妹 2020-12-19 10:24

I am trying to use cx-freeze to create a static self-contained distribution of my app (The Spye Python Engine, www.spye.dk), however, when I run cx-freeze, it says:

2条回答
  •  星月不相逢
    2020-12-19 10:36

    Missing modules aren't necessarily a problem: a lot of modules try different imports to accommodate different platforms or different versions of Python. In subprocess, for example, you can find this code:

    if mswindows:
        ...
        import _subprocess
    

    cx_Freeze doesn't know about this, so it will try to find _subprocess on Linux/Mac as well, and report it as missing. Specifying them in includes doesn't change anything, because it's trying to include them, but unable to find them.

    It should build a file anyway, so try running that and seeing if it works.

提交回复
热议问题