oliviermarti · GitHub

Description of the issue

I'm trying to test pyinstaller on a very simple python script which is only print ("Hello world"), and it fails with SystemError: codesign command (['codesign', '--remove', '--all-architectures', '/Users/marti/build/hello/hello']) failed with error code 106!

I've seen lot of issues about MacOS X signing, but I couldn't find a solution. Is it supposed to work on Mac OSX 14.5 ?

I've test a few options with no success.

Context information (for bug reports)

  • Output of pyinstaller --version : 6.7.0
  • Version of Python: 3.11.9
  • Platform: Mac OS Sonoma 14.5 macOS-14.5-arm64-arm-64bit
  • How you installed Python: conda

A minimal example program which shows the error

print ("Hello world")

Stacktrace / full error message

> pyinstaller  hello.py
234 INFO: PyInstaller: 6.7.0, contrib hooks: 2024.6
234 INFO: Python: 3.11.9 (conda)
295 INFO: Platform: macOS-14.5-arm64-arm-64bit
296 INFO: wrote /Users/marti/hello.spec
300 INFO: Extending PYTHONPATH with paths
['/Users/xxxx']
466 INFO: checking Analysis
469 INFO: checking PYZ
470 INFO: EXE target arch: arm64
470 INFO: Code signing identity: None
473 INFO: checking PKG
473 INFO: Bootloader /Users/marti/miniforge3/envs/FULL/lib/python3.11/site-packages/PyInstaller/bootloader/Darwin-64bit/run
473 INFO: checking EXE
473 INFO: Building EXE because EXE-00.toc is non existent
473 INFO: Building EXE from EXE-00.toc
473 INFO: Copying bootloader EXE to /Users/marti/build/hello/hello
474 INFO: Converting EXE to target arch (arm64)
474 INFO: Removing signature(s) from EXE
Traceback (most recent call last):
 File "/Users/xxxx/miniforge3/envs/FULL/bin/pyinstaller", line 11, in <module>
   sys.exit(run())
            ^^^^^
 File "/Users/xxxx/miniforge3/envs/FULL/lib/python3.11/site-packages/PyInstaller/__main__.py", line 212, in run
   run_build(pyi_config, spec_file, **vars(args))
 File "/Users/xxxx/miniforge3/envs/FULL/lib/python3.11/site-packages/PyInstaller/__main__.py", line 69, in run_build
   PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
 File "/Users/xxxx/miniforge3/envs/FULL/lib/python3.11/site-packages/PyInstaller/building/build_main.py", line 1189, in main
   build(specfile, distpath, workpath, clean_build)
 File "/Users/xxxx/miniforge3/envs/FULL/lib/python3.11/site-packages/PyInstaller/building/build_main.py", line 1129, in build
   exec(code, spec_namespace)
 File "/Users/xxxx/hello.spec", line 19, in <module>
   exe = EXE(
         ^^^^
 File "/Users/xxxx/miniforge3/envs/FULL/lib/python3.11/site-packages/PyInstaller/building/api.py", line 643, in __init__
   self.__postinit__()
 File "/Users/xxxx/miniforge3/envs/FULL/lib/python3.11/site-packages/PyInstaller/building/datastruct.py", line 184, in __postinit__
   self.assemble()
 File "/Users/xxxx/miniforge3/envs/FULL/lib/python3.11/site-packages/PyInstaller/building/api.py", line 820, in assemble
   osxutils.remove_signature_from_binary(build_name)
 File "/Users/xxxx/miniforge3/envs/FULL/lib/python3.11/site-packages/PyInstaller/utils/osx.py", line 365, in remove_signature_from_binary
   raise SystemError(f"codesign command ({cmd_args}) failed with error code {p.returncode}!\noutput: {p.stdout}")
SystemError: codesign command (['codesign', '--remove', '--all-architectures', '/Users/marti/build/hello/hello']) failed with error code 106!
output: --sign is required
Run with --help for more information.

Read the original on github.com ↗