10

I am trying to pip install pybluez and I get this error:

Collecting PyBluez
  Using cached PyBluez-0.23.tar.gz (97 kB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [1 lines of output]
      error in PyBluez setup command: use_2to3 is invalid.
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

How do I solve this?

Edit: Turns out its not being updated for windows so I just switched to a linux vb

4
  • This started happening to me in recent pip installations and I honestly don't like it. Anyway, try downgrading your pip. Commented Mar 23, 2023 at 1:12
  • For package specific issues, using their issue tracker can help - they have resolved this issue in their source but has not packaged it for PyPI. Searching further will point you to this comment about how to install the latest source release which should workaround this issue. Commented Mar 23, 2023 at 1:13
  • This is a known issue, with a known solution. github.com/pybluez/pybluez/issues/431#issuecomment-1107884273. This is why the posting guidelines start with telling you to search and research before posting =) Commented Mar 23, 2023 at 1:20
  • stackoverflow.com/… Commented Mar 23, 2023 at 8:42

1 Answer 1

27

As Mike 'Pomax' Kamermans suggested, you can solve this by installing the package from source:

pip install git+https://github.com/pybluez/pybluez.git#egg=pybluez

Indeed,

The pypi version is outdated and this issue is fixed in the dev version ages ago.

Source: This answer was provided by dogtopus on a GitHub issue of the pybluez repository.

Sign up to request clarification or add additional context in comments.

2 Comments

Installing from the source as given above did not work for me. In file included from bluez/btmodule.c:21: 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/aarch64-linux-gnu-gcc' failed with exit code 1 [end of output]
@PeterWiley you probably need to install the bluetooth development headers: sudo apt install libbluetooth-dev

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.