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

python3-bluez: No module named 'bluetooth._bluetooth' on non-x86_64 systems #1509

Closed
ElementW opened this issue Aug 6, 2018 · 3 comments
Closed

Comments

@ElementW
Copy link
Contributor

ElementW commented Aug 6, 2018

System

  • xuname: Void 4.14.52_1 armv7l-musl uptodate r
  • package: python3-bluez-0.22_3

Steps to reproduce the behavior

Import the bluetooth module in Python 3.

Expected behavior

Importing the bluetooth module on Python 3 works.

Actual behavior

Library is generated as /usr/lib/python3.6/site-packages/bluetooth/_bluetooth.cpython-36m-x86_64-linux-gnu.so (which does target the good architecture, not x86_64 as the name implies), and Python fails to load it due to mismatching arch in the filename:

Traceback (most recent call last):
  File "./bt_test.py", line 3, in <module>
    import bluetooth
  File "/usr/lib/python3.6/site-packages/bluetooth/__init__.py", line 45, in <module>
    from bluetooth.bluez import *
  File "/usr/lib/python3.6/site-packages/bluetooth/bluez.py", line 10, in <module>
    import bluetooth._bluetooth as _bt
ModuleNotFoundError: No module named 'bluetooth._bluetooth'

Moving the .so to /usr/lib/python3.6/site-packages/bluetooth/_bluetooth.so cascades into yet another error:

ImportError: Error relocating /usr/lib/python3.6/site-packages/bluetooth/_bluetooth.so: Py_InitModule4: symbol not found

This means the .so is built for Python 2 as the Py_InitModule family of symbols are not used any more since Python 3 (nm -D /usr/lib/python3.6/site-packages/bluetooth/_bluetooth.so | grep Py_InitModule4 shows it's an undefined symbol so the linker tries to import it, alas in vain).

Something is most likely wrong with the cross-compilation environment.

Installing PyBluez from pip works properly.

@maxice8
Copy link
Contributor

maxice8 commented Jan 31, 2019

Should be fixed by #8039

@teldra
Copy link
Contributor

teldra commented Feb 1, 2019

is this #4639 also solved by #8039 ?

@maxice8
Copy link
Contributor

maxice8 commented Feb 1, 2019

Should be fixed by #8039

@maxice8 maxice8 closed this as completed Feb 1, 2019
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 24, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants