在没有任何工作时将 python 3.5 转换为可执行文件

Convert python 3.5 to an executable when nothing is working

请在标记为重复之前阅读

这是我尝试过的:

Pyinstaller:

每当我尝试 运行 可执行文件时,我都会收到 pyi-rth qt5plugins 致命错误。我在实际制作程序时没有收到任何警告(在第二次 运行 期间,因为所有那些 windows crt 第一次出现)。据我所知,Qt dll 也在该文件夹中,但是因为我没有收到警告,所以我不知道它认为它缺少什么。

更新: 所以我第一次 运行 pyinstaller 我得到了像这样的大量警告列表

lib not found: api-ms-win-crt-string-l1-1-0.dll dependency of      c:\users\name\appdata\local\programs\python\python35-32\lib\site-    packages\PIL\_imaging.cp35-win32.pyd

我被告知(错误?)只是 windows 现在必须制作这些临时文件的结果,要修复它,我所要做的就是再次 运行 相同的命令没有改变任何东西(到现在为止似乎确实有效)。

运行 第二次我没有收到任何警告或任何东西,但尝试 运行 exe 收到此错误:

Traceback (most recent call last):
  File "site-packages\PyInstaller\loader\rthooks\pyi_rth_qt5plugins.py", line 46, in <module>
  File "c:\users\cryan\appdata\local\programs\python\python35-32\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 573, in load_module
    module = loader.load_module(fullname)
ImportError: DLL load failed: The specified procedure could not be found.
Failed to execute script pyi_rth_qt5plugins

py2exe:

我收到这个错误

File "C:\Users\name\AppData\Local\Programs\Python\Python35-32\lib\site-packages\olefile\olefile2.py", line 225
    raise ValueError, 'Need to fix a bug with 32 bit arrays, please contact author...'

cx-冻结:

method = dis._unpack_opargs if sys.version_info[:2] >= (3, 5) \
AttributeError: module 'dis' has no attribute '_unpack_opargs'

所以我不知道还能尝试什么。我想指出 pyinstaller 一段时间前工作正常,从那时起我很确定我在构建的那一刻没有改变任何东西并且 运行 使它们正常运行然后突然之间我开始变得错误,此后没有任何效果

我还能尝试什么?

我找到了解决 pyinstaller 问题的方法。按照说明进行操作 here

基本上删除以下内容(取决于您的OS):

%APPDATA%\pyinstaller
$XDG_DATA_HOME/pyinstaller
~/Library/Application Support/pyinstaller

然后安装开发版本:

pip install https://github.com/pyinstaller/pyinstaller/archive/develop.zip

这对我适用于 py2exe:

py -m pip install olefile --upgrade

olefile 中的错误已在最新版本中得到修复。一旦我更新了这个包,错误就消失了。