Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OSError: dlopen(libc.so.6, 6): image not found #48

Open
linxucc opened this issue Apr 20, 2020 · 2 comments
Open

OSError: dlopen(libc.so.6, 6): image not found #48

linxucc opened this issue Apr 20, 2020 · 2 comments

Comments

@linxucc
Copy link

linxucc commented Apr 20, 2020

Hi Adam,

I try to use pybleno on MacOS Mojave 10.14.6, when I try to import the pybleno

from pybleno import *

I got this error.

'OSError: dlopen(libc.so.6, 6): image not found'

I've done some research it seems that the on MacOS the file name of dynamic lib is '.dylib' instead of '.so'. There are some stack overflow thread on this like this, https://stackoverflow.com/questions/11554355/mac-os-x-lion-python-ctype-cdll-error-lib-so-6-image-not-found

I know I can make a soft-link to get it working, but maybe it could be better improved in library itself?

Thanks!

@linxucc
Copy link
Author

linxucc commented Apr 20, 2020

Answer my own question, the pybleno is not supported by MacOS in any possible way.

Hope this helps others with same attempt.

It's not the lib name or other small import naming problems, it's because this library is using Wayne Keenan's BluetoothHCI (https://github.com/TheBubbleworks/python-hcipy) as the underlying low-level communication to the bluetooth HCI (hardware module).
And the BluetoothHCI library "python-hcipy" is based on python's native bluetooth socket support, which is not implemented/available on MacOS.

When you fixed other issues and try to run, you'll get a error like this:

AttributeError: module 'socket' has no attribute 'AF_BLUETOOTH'

That's because the PYTHON on MacOS itself does NOT have this native bluetooth support. The hardware level abstraction on MacOS is not same as other Linux systems, even though they appears to be the same/alike.

So there's no way to make pybleno work on MacOS unless largely change the "python-hcipy" part of code to something else, like python bleson (https://github.com/TheCellule/python-bleson/), to which the author of "python-hcipy" himself has moved towards this cross-platform project.

Anyway thanks to Adam for making this lib, it's little sad that there're not that much libraries about bluetooth in python than on node.js.

So for anyone found this page when searching the same thing, if you are building something standalone and largely depends on BLE, maybe just go with node, it could save you much time. Or if you have to stick with python, maybe you could explore the "python-bleson" library.

Hope this helps.

@cogito666
Copy link

Thank you for your kind guidance to people who try to implement an application using BLE on MAC. You save my time.
Really appreciate for your comment!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants