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

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

Closed
zbioe opened this issue Apr 4, 2020 · 6 comments
Closed

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

zbioe opened this issue Apr 4, 2020 · 6 comments

Comments

@zbioe
Copy link

zbioe commented Apr 4, 2020

When i tried to execute script, i got this message.

    s = socket.socket(socket.AF_BLUETOOTH,
AttributeError: module 'socket' has no attribute 'AF_BLUETOOTH'

you know any solution for this?

i believe is some about my system config, but i can't find anything about this, i can isolate the problem using:

$ python -c "import socket; socket.AF_BLUETOOTH"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
AttributeError: module 'socket' has no attribute 'AF_BLUETOOTH'

Thhank's for project, is really useful

@TheWeirdDev
Copy link
Owner

What is your operating system? What python version are you using?

@zbioe
Copy link
Author

zbioe commented Apr 4, 2020

OS void linux:

$ uname -srvmo
Linux 5.4.27_1 #1 SMP PREEMPT Sat Mar 21 09:34:54 UTC 2020 x86_64 GNU/Linux

Python 3.8.2:

$ python --version
Python 3.8.2

@TheWeirdDev
Copy link
Owner

Seems like your python binary was built without Bluetooth socket support. You need to install python from another repository or the official website.

@zbioe
Copy link
Author

zbioe commented Apr 4, 2020

You're right, i just download and compile the site version, and works like a spell.

Thank you very much.

@bit-man
Copy link

bit-man commented May 7, 2020

For Python3. bluetooth support is not installed unless libbluetooth-dev package is installed as well

@TheWeirdDev
Copy link
Owner

TheWeirdDev commented May 22, 2020

The new version doesn't require AF_BLUETOOTH and uses PyBluez library instead. No one will encounter this issue again.

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

3 participants