amazon-ion / ion-python

A Python implementation of Amazon Ion.
https://amazon-ion.github.io/ion-docs/
Apache License 2.0
260 stars 51 forks source link

Soft-fail on ImportError when importing c libs #300

Closed rmarrowstone closed 1 year ago

rmarrowstone commented 1 year ago

I had seen a previous report of a user unable to use a release of ion-python due to an ImportError other than ModuleNotFoundException. I thought it was isolated to that instance, but a different user encountered the same problem but due to a misalignment of linked to vs runtime libionc shared objects.

rmarrowstone commented 1 year ago

I was able to reproduce this in test by moving the libionc.so I was using.

E   ImportError: dlopen(/Users/calhounr/ion-python-ws/ion-python/amazon/ion/ionc.cpython-310-darwin.so, 0x0002): Library not loaded: @rpath/libionc.1.0.6.dylib
E     Referenced from: <B0C48488-21CC-3ACE-9F52-EB55AEF04413> /Users/calhounr/ion-python-ws/ion-python/amazon/ion/ionc.cpython-310-darwin.so
E     Reason: tried: '$ORIGIN/ion-c-build/lib/libionc.1.0.6.dylib' (no such file), '/Users/calhounr/ion-python-ws/ion-python/amazon/ion/ion-c-build/lib/libionc.1.0.6.dylib' (no such file), '$ORIGIN/ion-c-build/lib/libionc.1.0.6.dylib' (no such file), '/Users/calhounr/ion-python-ws/ion-python/amazon/ion/ion-c-build/lib/libionc.1.0.6.dylib' (no such file)