Python Forum
ModuleNotFoundError: No module named 'bluetooth' Error - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: ModuleNotFoundError: No module named 'bluetooth' Error (/thread-34782.html)



ModuleNotFoundError: No module named 'bluetooth' Error - Rovelin - Aug-31-2021

Hi everyone, when I'm trying to run the code below, Im getting ModuleNotFoundError: No module named 'bluetooth' error and even if I pip install pybluez it doesn't solves the problem.

import bluetooth

def connect ():
bd_addr = "x:x:x:x:x:x"
port = 1
sock=bluetooth.BluetoothSocket(bluetooth.RFCOMM)
sock.connect((bd_addr, port))
sock.send("hello!!")
sock.close()

connect()

I'm using a win10 and I couldn't understand what to do about it. I tried to use setup.py but it didn't work either.


RE: ModuleNotFoundError: No module named 'bluetooth' Error - MahendraYadav - Aug-31-2021

Try to install the Module
pip install pybluez


RE: ModuleNotFoundError: No module named 'bluetooth' Error - Rovelin - Aug-31-2021

Firstly, thank you for your response. That was the first thing that I tried. Here is the response of the command. https://ibb.co/2yyw8Nm


RE: ModuleNotFoundError: No module named 'bluetooth' Error - snippsat - Aug-31-2021

Windows Dependencies
Quote:PyBluez requires a C++ compiler installed on your system to build CPython modules.

For Python 3.5 or higher

Microsoft Visual C++ 14.0 standalone: Build Tools for Visual Studio 2017 (x86, x64, ARM, ARM64)
Microsoft Visual C++ 14.0 with Visual Studio 2017 (x86, x64, ARM, ARM64)
Microsoft Visual C++ 14.0 standalone: Visual C++ Build Tools 2015 (x86, x64, ARM)
Microsoft Visual C++ 14.0 with Visual Studio 2015 (x86, x64, ARM)
There are wheel here but only up to Python 3.7.


RE: ModuleNotFoundError: No module named 'bluetooth' Error - Rovelin - Aug-31-2021

Thank you now I'm looking for the microsoft visual downloads because it says error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/ on my last try. But I'm little bit confused about how to find every package because some of them directly makes me download microsoft visal studio.