academic-web1
academic-web1

Reputation: 31

Security issues downloading application for MacOS - "library load disallowed by system policy"

I recently created an application using Pyinstaller, and have bundled it correctly. It theoretically should be able to work on other macbooks now. However, I have tried zipping the application, storing it on Google Drive, and then downloading and running it on my own and other macbooks. I have hit a security issue:

Traceback (most recent call last):
  File "_pyinstaller_hooks_contrib/hooks/rthooks/pyi_rth_certifi.py", line 13, in <module>
  File "PyInstaller/loader/pyimod03_importers.py", line 531, in exec_module
  File "ssl.py", line 98, in <module>
ImportError: dlopen(/Users/a/Downloads/main/_ssl.cpython-37m-darwin.so, 2): no suitable image found.  Did find:
    /Users/a/Downloads/main/_ssl.cpython-37m-darwin.so: code signature in (/Users/a/Downloads/main/_ssl.cpython-37m-darwin.so) not valid for use in process using Library Validation: library load disallowed by system policy
[50024] Failed to execute script pyi_rth_certifi

Any ideas on how to overcome this would be really appreciated! Thank you.

Upvotes: 2

Views: 8565

Answers (1)

academic-web1
academic-web1

Reputation: 31

I have resolved the issue and thought I'd share my answer! Before distributing the app, on MacOS you have to codesign it. This is the site that helped me: https://github.com/pyinstaller/pyinstaller/wiki/Recipe-OSX-Code-Signing. Hope this eventually helps someone.

Upvotes: 1

Related Questions