question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

macOS: Official CPython packages give "code signature invalid"

See original GitHub issue
  • MacOS Catalina (10.15)
  • Nuitka v0.6.8.4
  • Python v3.8.3
  • Nuitka installed from pip
  • Python installed from official package on python.org

For some reason no Nuitka compiled package works on my MacOS. I’ve just tested with a print("Hello World") compiled with python -m nuitka --standalone test.py and the result is always this:

dyld: Library not loaded: @executable_path/Python
  Referenced from: /test.dist/./main
  Reason: no suitable image found.  Did find:
	/test.dist/./Python: code signature invalid for '/test.dist/./Python'

	/test.dist/./Python: stat() failed with errno=1
	/test.dist/Python: code signature invalid for '/test.dist/Python'

	/test.dist/Python: stat() failed with errno=1
zsh: abort      ./test

I found issue #672 that is similar but the proposed solution of using a venv doesn’t change anything for me.

The output for otool -L:

/bin/python:
	/Library/Frameworks/Python.framework/Versions/3.8/Python (compatibility version 3.8.0, current version 3.8.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1197.1.1)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:28 (19 by maintainers)

github_iconTop GitHub Comments

1reaction
kayhayencommented, Feb 7, 2021

Fixed, see #789 it seems the code signature must be removed or else it will not be possible to load the DLL.

0reactions
kayhayencommented, Feb 13, 2021

Released as part of 0.6.12

Read more comments on GitHub >

github_iconTop Results From Across the Web

code signature in [app] not valid … | Apple Developer Forums
Given that, there's never any need to disable library validation. Rather, you should sign your dependencies as part of the process of signing...
Read more >
Mac M1 chip issues with rosetta, “attachment of code ...
One of the following will fix the issue IMHO. Restart Mac OS. Upgrade OS (will restart after the upgrade); Upgrade Docker, Upgrade OS, ......
Read more >
macOS: Bundled python needs additional entitlements to run ...
code signature in (./example_dependencies/pyclipper.cpython-38-darwin.so) not valid for use in process using Library Validation: mapped file ...
Read more >
Changelog — Python 3.11.1 documentation
gh-96678: Fix undefined behaviour in C code of null pointer arithmetic. ... gh-91447: Fix findtext in the xml module to only give an...
Read more >
HP Utility fails with Code Signature Invalid MacOS 10.15.7 ...
Solved: Trying to open Printer Utility on MacOS 10.15.7 and I get a crash dump every time saying "Code Signature Invalid" for the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found