Create a python 3 exe with pyinstaller with Pmw module

我的梦境 提交于 2021-01-29 02:29:49

问题


Based on this Previos Post I'm trying to figure out how to make an exe out of my python files. The main issue seems to be that Pmw and its modules do not seem to import correctly though pyinstaller. The main error says:

FileNotFoundError: [WinError 3] The system cannot find the path specified: 'C:\User\Name\AppData\Local\Temp\_MEI61522\Pmw

Looking at the Pmw init it seems what it's doing is looking for files in the directory which have Pmw_### and looking in there which has lib and then PmwLoader.suffix and loadther then imports all the dependencies

So now it seems pyinstaller isn't understanding this file dependency system created by Pmw and when I tried to follow the previous post instruction I ran into other errors that made the code unable to compile.

If anyone has any insight on this, that would be fantastic


回答1:


PMW has a script for bundling (almost) everything into one file which I found in Lib\site-packages\Pmw\Pmw_\bin\bundlepmw.py My version wasn't entirely Python 3 compliant so I had to make a few edits to the file before adding it to my sources. Ugly but it worked for me.




回答2:


Welp, I gave up on pyinstaller and downgraded to python 3.4 and used cx_freeze and created created a single Pmw.py file from some code which I found from python-pmw-and-cx-freeze



来源:https://stackoverflow.com/questions/40559477/create-a-python-3-exe-with-pyinstaller-with-pmw-module

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!