Py2Exe “The following modules are missing”

后端 未结 1 676
悲哀的现实
悲哀的现实 2021-01-21 13:30

When using Py2Exe, I get a warning such as

The following modules appear to be missing
[\'Crypto\', \'Crypto.Cipher\', \'Crypto.Hash\', \'Padding\']
1条回答
  •  逝去的感伤
    2021-01-21 14:07

    First, check if your packages are in .EGG format

    It appears Py2Exe has problems with Python's .egg packages. By extracting the .egg files (rename to .zip and extract into site-packages excluding EGG-INFO folder), Py2Exe can now detect those packages without issues.

    Check your setup.py to make sure you're using the right option. Windowed applications use "windows=" where-as console applications use "console="

    In some other cases it could be through the use of setup(console=['main.py']) instead of setup(windows=['main.py']) if you're producing a windowed application.

    If it's still not working, you can try telling Py2Exe to manually include the package

    Some packages can further be resolved by adding them to the package options of your setup.py like this:

    setup(
        windows=['main.py'],
        options={
                "py2exe":{
                        "packages": ["Crypto", "Padding"]
                }
        }
    

    0 讨论(0)
提交回复
热议问题