首页 > 解决方案 > 如何在 Python3.6 中激活 socket.AF_BLUETOOTH?

问题描述

我在 Windows 中使用 Python3.6 标准安装,我尝试这样做

>>>import socket
>>>socket.AF_BLUETOOTH

系统响应

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

我和一位同事已经花了一些时间阅读论坛。我扫描了 PythonPath\Lib\ 中的 socket.py,但也没有提到 AF_BLUETOOTH。Anaconda Python中有一个stackoverflow线程Missing socket.AF_BLUETOOTH?其中谈到了重新编译 Python 并在一些 .header 文件中进行了一些更改。

谁能提供更多详细信息如何访问正在运行的 Python/socket/蓝牙?

标签: pythonsocketsbluetoothbluetooth-lowenergy

解决方案


似乎它在 windows 端口上不可用:

可以在 linux 上使用 3.6.7

在 w10 上以 3.6.7 KO

最好在文档中有警告,我已经找到了...


推荐阅读