Python Forum

Full Version: ModuleNotFoundError: No module named 'bluetooth' Error
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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.
Try to install the Module
pip install pybluez
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
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.
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/visua...ild-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.