Pyinstaller Illegal Instruction 4(其他电脑)

时间:2014-08-11 20:13:20

标签: python pyinstaller

遇到pyinstaller问题。我试图使用PyInstaller发布一个exe / app文件。但是,任何试图打开我的文件的人最终都会收到非法指令4错误。

只有在我尝试在我的机器上编译并发送给其他人时才会发生这种情况。使用相同进程和spec文件编译的其他人不会看到同样的问题。当我打开自己的文件时,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]

2 个答案:

答案 0 :(得分:2)

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

答案 1 :(得分:1)

我也遇到过这样的问题,最后我转而使用nuitka