opencultureconsulting / openrefine-client

The OpenRefine Python Client from Paul Makepeace provides a library for communicating with an OpenRefine server. This fork extends the command line interface (CLI) and is distributed as a convenient one-file-executable (Windows, Linux, Mac). It is also available via Docker Hub, PyPI and Binder.
GNU General Public License v3.0
83 stars 19 forks source link

macOS release: code signature invalid #19

Open steffenfritz opened 3 years ago

steffenfritz commented 3 years ago

Hi!

  1. I downloaded release version 0.3.10 for macOS
  2. chmod +x openrefine-client_0-3-10_macos
  3. ./openrefine-client_0-3-10_macos

Directly after the start this leads to this error:

[2053] Error loading Python lib '/var/folders/rt/mbz5zkp533sgg49fmm6ky3tr0000gn/T/_MEIbj0YQp/Python': dlopen: dlopen(/var/folders/rt/mbz5zkp533sgg49fmm6ky3tr0000gn/T/_MEIbj0YQp/Python, 10): no suitable image found.  Did find:
    /var/folders/rt/mbz5zkp533sgg49fmm6ky3tr0000gn/T/_MEIbj0YQp/Python: code signature invalid for '/var/folders/rt/mbz5zkp533sgg49fmm6ky3tr0000gn/T/_MEIbj0YQp/Python'

macOS Version 11.4 on M1

felixlohmeier commented 3 years ago

Hi Steffen, Thank you very much for raising this issue!

This seems to be a PyInstaller issue which was fixed in PyInstaller 4.2

Recent version of python on macOS have their Python shared library signed due to Gatekeeper requirements. Due to partial collection of content from the Python.framework, the copy of Python shared library that we bundle with frozen application ends up with its signature invalidated, and refuses to load regardless of Gatekeeper settings.

Unfortunately, I can't just generate a new executable for macOS with a newer PyInstaller version because PyInstaller dropped support for Python 2 with version 4.0.

I probably won't find a quick solution. So for now you are left with two options:

  1. native installation in a Python2 environment.
  2. using the Docker container
ncarboni commented 2 years ago

Same problem here. Using docker (although not ideal) solve the issue. Just a note, if you are using Docker with an Apple Silicon the correct command should include the string --platform linux/amd64, as below:

docker run --rm --platform linux/amd64 --network=host -v ${PWD}:/data:z felixlohmeier/openrefine-client:v0.3.10