问题
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