我想用Python测试设备的蓝牙rssi值,但是在Ubuntu中安装时出现问题

问题描述 投票:0回答:2

我使用

sudo apt-get install bluetooth libbluetooth-dev
(libbluetooth-dev和bluetooth是最新版本)后,我输入
sudo python3 -m pip install pybluez
,但显示:

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.

请问谁能帮我解决这个问题

python bluetooth pybluez
2个回答
2
投票

pypi 版本已经过时,这个问题很久以前就在 dev 版本中修复了。请使用以下命令从源安装它

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

这已经在这个github问题中讨论过


0
投票

@cloud 确保安装完成

sudo apt-get install bluetooth libbluetooth-dev

© www.soinside.com 2019 - 2024. All rights reserved.