pc-ble-driver-py icon indicating copy to clipboard operation
pc-ble-driver-py copied to clipboard

Breaks on MacOS Monterey, hardcoded library location

Open pavelkomarov opened this issue 2 years ago • 2 comments

You guys hardcoded your library to look for python where it ends up when installing from https://www.python.org/downloads/macos. This means if you instead install with brew you get an error like

ImportError: dlopen(.../lib/python3.9/site-packages/pc_ble_driver_py/lib/_nrf_ble_driver_sd_api_v5.so, 0x0002): Library not loaded: /Library/Frameworks/Python.framework/Versions/3.9/Python
  Referenced from: .../lib/python3.9/site-packages/pc_ble_driver_py/lib/_nrf_ble_driver_sd_api_v5.so
  Reason: tried: '/Library/Frameworks/Python.framework/Versions/3.9/Python' (no such file), '/System/Library/Frameworks/Python.framework/Versions/3.9/Python' (no such file)

I can work around the issue by creating a symlink

ln -s /usr/local/Cellar/[email protected]/3.9.7/Frameworks/Python.framework/Versions/3.9/ /Library/Frameworks/Python.framework/Versions/3.9

but I shouldn't have to. This should be fixed to work with python installs in either location.

pavelkomarov avatar May 05 '22 00:05 pavelkomarov

This leads several workarounds & extra documentation around projects that based on pc-ble-driver-py so fix would be more than welcome. I guess this should not need much effort overall..

jupe avatar Nov 16 '22 09:11 jupe

I have the same issue except it's looking for Python version 2.7 in system directory:

ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pc_ble_driver_py/lib/macos_osx/_pc_ble_driver_sd_api_v3.so, 0x0002): Library not loaded: '/System/Library/Frameworks/Python.framework/Versions/2.7/Python'
  Referenced from: '/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pc_ble_driver_py/lib/macos_osx/_pc_ble_driver_sd_api_v3.so'
  Reason: tried: '/System/Library/Frameworks/Python.framework/Versions/2.7/Python' (no such file)

Why is yours looking for 3.9? I can't symlink as 2.7 isn't installed on my system.

Edit: nevermind. pip doesn't seem to install the latest verson. I grabbed pc_ble_driver_py-0.17.0-cp310-cp310-macosx_10_9_x86_64.whl from the releases page and it worked

savvn001 avatar Dec 12 '22 16:12 savvn001