【问题标题】:Pyinstaller Illegal Instruction 4 (other computers)Pyinstaller非法指令4(其他电脑)
【发布时间】:2014-08-11 20:13:20
【问题描述】:

pyinstaller 遇到问题。我正在尝试使用 PyInstaller 发送一个 exe/app 文件。但是,任何试图打开我的文件的人最终都会收到 Illegal Instruction 4 错误。

只有当我尝试在我的机器上编译并发送给其他人时才会发生这种情况。其他使用相同流程和规范文件编译的人没有看到同样的问题。当我打开自己的文件时,exe 和 app 文件打开时不会出错。

任何和所有的想法都表示赞赏!

系统详情:

OSX 10.9.4(所有机器都在这个)

我的 PyInstaller 输出:

(veControl)ahaq-mbp-10028:asimov-control ahaque$ pyinstaller asimov_gui.spec --onefile
23 WARNING: You are running 64-bit Python: created binaries will only work on Mac OS X 10.6+.
If you need 10.4-10.5 compatibility, run Python as a 32-bit binary with this command:

VERSIONER_PYTHON_PREFER_32_BIT=yes arch -i386 /Users/ahaque/asimov-control/veControl/bin/python

4029 INFO: UPX is not available.
4050 INFO: Processing hook hook-os
4152 INFO: Processing hook hook-time
4154 INFO: Processing hook hook-cPickle
4220 INFO: Processing hook hook-_sre
4330 INFO: Processing hook hook-cStringIO
4424 INFO: Processing hook hook-encodings
4437 INFO: Processing hook hook-codecs
4756 INFO: Extending PYTHONPATH with /users/ahaque/asimov-control
4756 INFO: checking Analysis
4806 INFO: checking PYZ
4825 INFO: checking PKG
4844 INFO: checking EXE
4845 INFO: checking BUNDLE
4845 INFO: building BUNDLE out00-BUNDLE.toc
(veControl)ahaq-mbp-10028:asimov-control ahaque$ 

别人终端的输出:

Last login: Mon Aug 11 13:05:00 on ttys002
LOADER: executable is /Users/dachelis/Downloads/Asimov_GUI 2
LOADER: homepath is /Users/dachelis/Downloads
LOADER: _MEIPASS2 is NULL
LOADER: archivename is /Users/dachelis/Downloads/Asimov_GUI 2
LOADER: Extracting binaries
LOADER: Executing self as child
LOADER: set _MEIPASS2 to /var/folders/q6/nxdsj2_x6x3d32pcjqf2468wwtqnq6/T/_MEIlbLNev
LOADER: executable is /Users/dachelis/Downloads/Asimov_GUI 2
LOADER: homepath is /Users/dachelis/Downloads
LOADER: _MEIPASS2 is /var/folders/q6/nxdsj2_x6x3d32pcjqf2468wwtqnq6/T/_MEIlbLNev
LOADER: archivename is /Users/dachelis/Downloads/Asimov_GUI 2
LOADER: Already in the child - running user's code.
LOADER: Python library: /var/folders/q6/nxdsj2_x6x3d32pcjqf2468wwtqnq6/T/_MEIlbLNev/.Python
LOADER: Manipulating evironment
LOADER: PYTHONPATH=/var/folders/q6/nxdsj2_x6x3d32pcjqf2468wwtqnq6/T/_MEIlbLNev
LOADER: PYTHONHOME=/var/folders/q6/nxdsj2_x6x3d32pcjqf2468wwtqnq6/T/_MEIlbLNev
LOADER: Manipulating Python's sys.path
LOADER: importing modules from CArchive
LOADER: extracted struct
LOADER: extracted pyi_os_path
LOADER: extracted pyi_archive
LOADER: extracted pyi_importers
LOADER: Installing import hooks
LOADER: out00-PYZ.pyz
LOADER: Running scripts
Illegal instruction: 4
logout

[Process completed]

【问题讨论】:

    标签: python pyinstaller


    【解决方案1】:

    这个问题源于你打包的python版本不兼容。您可能使用的是通过 Homebrew 或 MacPorts 在系统上编译的版本。由于编译器优化,这可能导致二进制文件与其他 OS X 机器不完全兼容。一个简单的解决方案是下载 ActivePython 并确保您使用它来打包您的源代码。

    【讨论】:

      【解决方案2】:

      我也遇到过这样的问题,最后改用nuitka

      【讨论】:

        猜你喜欢
        • 2021-06-14
        • 1970-01-01
        • 1970-01-01
        • 2019-06-15
        • 2018-03-20
        • 2018-10-29
        • 2012-03-12
        • 2017-09-10
        • 1970-01-01
        相关资源
        最近更新 更多