Py2Exe “Missing Modules”

前端 未结 2 2016
梦谈多话
梦谈多话 2020-12-11 02:17

I\'m trying to convert my python project into an exe using Py2Exe. It is worth noting that cx_freeze complains about the same three \"missing modules\", along with several d

相关标签:
2条回答
  • 2020-12-11 02:47

    win32api and win32con are part of Mark Hammond's Python Windows extensions (aka pywin32). readline is a module that is used (if present) by some code interacting with the console.

    Both readline and pywin32 are optional modules/packages that are not abolutely required but will be used when present.

    All in all - py2exe notices that these modules/packages are referenced by some code which will be included into your exe (it even mentions the modules that reference these mod/packages: cmd, code, pdb, platform). I hope you have tested your script - in the 'non-compiled' form, if it works correctly than you can safely ignore these messages: they are only warnings.

    The reason that no executable is built is that the line 'console=["redstring"]' or 'windows=["redstring"]' is missing in the setup() call.

    0 讨论(0)
  • 2020-12-11 02:48

    So, it would happen that these libraries were never installed to begin with. Python may be "batteries included", but not to this extent. However, I'm answering this because fixing it isn't the most obvious thing in the world to some (myself included).

    You need to install win32api (or pywin32, as it is officially called) from Sourceforge (at the moment, browse the files for the latest version, as the Download button links to README.txt) That will resolve win32con as well. (You cannot install pywin32 from pip at the moment, unfortunately.)

    readline is not compatible with Windows, yet it asks for it. You actually have to install pyreadline, which is easiest from pip install pyreadline.

    That should resolve all of those issues for py2exe. I'm still having trouble, but it's different trouble, so it's a different question.

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