I am trying to install the pybluez package, however I am getting the same error as I already had gotten while trying to install btzen, which then I just skipped. here is what my terminal looks like so far;

$ pip install pybluez --break-system-packages
Defaulting to user installation because normal site-packages is not writeable
Collecting pybluez
  Using cached PyBluez-0.23.tar.gz (97 kB)
  Preparing metadata (setup.py) ... done
Building wheels for collected packages: pybluez
  Building wheel for pybluez (setup.py) ... error
  error: subprocess-exited-with-error
  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [25 lines of output]
      /home/kaustubhpawar/.local/lib/python3.11/site-packages/setuptools/_distutils/dist.py:275: UserWarning: Unknown distribution option: 'use_2to3'
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.linux-x86_64-3.11
      creating build/lib.linux-x86_64-3.11/bluetooth
      copying bluetooth/msbt.py -> build/lib.linux-x86_64-3.11/bluetooth
      copying bluetooth/bluez.py -> build/lib.linux-x86_64-3.11/bluetooth
      copying bluetooth/btcommon.py -> build/lib.linux-x86_64-3.11/bluetooth
      copying bluetooth/macos.py -> build/lib.linux-x86_64-3.11/bluetooth
      copying bluetooth/__init__.py -> build/lib.linux-x86_64-3.11/bluetooth
      copying bluetooth/widcomm.py -> build/lib.linux-x86_64-3.11/bluetooth
      copying bluetooth/ble.py -> build/lib.linux-x86_64-3.11/bluetooth
      running build_ext
      creating build/temp.linux-x86_64-3.11
      creating build/temp.linux-x86_64-3.11/bluez
      x86_64-linux-gnu-gcc -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -g -fwrapv -O2 -fPIC -I./port3 -I/usr/include/python3.11 -c bluez/btmodule.c -o build/temp.linux-x86_64-3.11/bluez/btmodule.o
      In file included from bluez/btmodule.c:20:
      bluez/btmodule.h:5:10: fatal error: bluetooth/bluetooth.h: No such file or directory
          5 | #include <bluetooth/bluetooth.h>
            |          ^~~~~~~~~~~~~~~~~~~~~~~
      compilation terminated.
      error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1
      [end of output]
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for pybluez
  Running setup.py clean for pybluez
Failed to build pybluez
ERROR: Could not build wheels for pybluez, which is required to install pyproject.toml-based projects

Also I am using the pip3 for this.

I already tried getting the pip package for wheels but that didn’t work at all. So I am at a roadblock right now.

New contributor

Disguised Tiger is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.