简体   繁体   English

PyInstaller 正在创建损坏的文件

[英]PyInstaller is creating a corrupt file

I am using pyinstaller 3.6 and running the command pyinstaller --onefile --windowed Splash.py and following is the terminal logs:我正在使用 pyinstaller 3.6 并运行命令pyinstaller --onefile --windowed Splash.py ,以下是终端日志:

40 INFO: PyInstaller: 3.6
40 INFO: Python: 3.8.2
50 INFO: Platform: Linux-5.2.0-kali2-amd64-x86_64-with-glibc2.29
54 INFO: UPX is available.
56 INFO: Extending PYTHONPATH with paths
['/root/Downloads/projects/wlt-retailer-python',
 '/root/Downloads/projects/wlt-retailer-python']
56 INFO: checking Analysis
56 INFO: Building Analysis because Analysis-00.toc is non existent
56 INFO: Initializing module dependency graph...
57 INFO: Caching module graph hooks...
63 INFO: Analyzing base_library.zip ...
2642 INFO: Processing pre-find module path hook   distutils
2642 INFO: distutils: retargeting to non-venv dir '/usr/lib/python3.8'
5487 INFO: Caching module dependency graph...
5588 INFO: running Analysis Analysis-00.toc
5622 INFO: Analyzing /root/Downloads/projects/wlt-retailer-python/src/main/python/Splash.py
6019 INFO: Processing pre-safe import module hook   six.moves
8999 INFO: Processing module hooks...
8999 INFO: Loading module hook "hook-xml.py"...
9075 INFO: Loading module hook "hook-pydoc.py"...
9076 INFO: Loading module hook "hook-cryptography.py"...
9280 INFO: Loading module hook "hook-lib2to3.py"...
9281 INFO: Loading module hook "hook-sysconfig.py"...
9292 INFO: Loading module hook "hook-xml.etree.cElementTree.py"...
9292 INFO: Loading module hook "hook-distutils.py"...
9293 INFO: Loading module hook "hook-encodings.py"...
9344 INFO: Loading module hook "hook-certifi.py"...
9345 INFO: Loading module hook "hook-_tkinter.py"...
9436 INFO: checking Tree
9436 INFO: Building Tree because Tree-00.toc is non existent
9437 INFO: Building Tree Tree-00.toc
9445 INFO: checking Tree
9445 INFO: Building Tree because Tree-01.toc is non existent
9445 INFO: Building Tree Tree-01.toc
9465 INFO: Looking for ctypes DLLs
9495 INFO: Analyzing run-time hooks ...
9501 INFO: Including run-time hook 'pyi_rth_multiprocessing.py'
9504 INFO: Including run-time hook 'pyi_rth_certifi.py'
9505 INFO: Including run-time hook 'pyi_rth__tkinter.py'
9517 INFO: Looking for dynamic libraries
10137 INFO: Looking for eggs
10138 INFO: Python library not in binary dependencies. Doing additional searching...
10184 INFO: Using Python library /lib/x86_64-linux-gnu/libpython3.8.so.1.0
10191 INFO: Warnings written to /root/Downloads/projects/wlt-retailer-python/build/Splash/warn-Splash.txt
10238 INFO: Graph cross-reference written to /root/Downloads/projects/wlt-retailer-python/build/Splash/xref-Splash.html
10253 INFO: checking PYZ
10253 INFO: Building PYZ because PYZ-00.toc is non existent
10253 INFO: Building PYZ (ZlibArchive) /root/Downloads/projects/wlt-retailer-python/build/Splash/PYZ-00.pyz
10886 INFO: Building PYZ (ZlibArchive) /root/Downloads/projects/wlt-retailer-python/build/Splash/PYZ-00.pyz completed successfully.
10894 INFO: checking PKG
10894 INFO: Building PKG because PKG-00.toc is non existent
10894 INFO: Building PKG (CArchive) PKG-00.pkg
16624 INFO: Building PKG (CArchive) PKG-00.pkg completed successfully.
16630 INFO: Bootloader /usr/local/lib/python3.8/dist-packages/PyInstaller/bootloader/Linux-64bit/run
16631 INFO: checking EXE
16631 INFO: Building EXE because EXE-00.toc is non existent
16631 INFO: Building EXE from EXE-00.toc
16631 INFO: Appending archive to ELF section in EXE /root/Downloads/projects/wlt-retailer-python/dist/Splash
16760 INFO: Building EXE from EXE-00.toc completed successfully.

And when I see in the dist folder, there is a file called Splash, but it is not an executable.而当我在 dist 文件夹中看到时,有一个名为 Splash 的文件,但它不是可执行文件。 I am doing all this Ubuntu 18 and sending my generated file to a windows 8 machine.我正在做所有这些 Ubuntu 18 并将我生成的文件发送到 windows 8 机器。 In windows 8 it shows the type of file as simply file, not and exe.在 windows 8 中,它将文件类型显示为简单的文件,而不是 exe。 So windows is unable to recognize the file type.所以 windows 无法识别文件类型。

pyinstaller is not supporting cross-compiling. pyinstaller 不支持交叉编译。 As stated in their documentation: to make a Windows app you run PyInstaller in Windows如他们的文档中所述:要制作 Windows 应用程序,您在 Windows 中运行 PyInstaller

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM