windows 如何修复子进程上的pybluez错误安装错误

4bbkushb  于 6个月前  发布在  Windows
关注(0)|答案(2)|浏览(152)

我想在Python中使用pyBluez,所以我运行“pip install pybluez”(我使用Win11 64GB),但发生了这个错误:

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.

字符串

qncylg1j

qncylg1j1#

你可以像这样从github安装新版本。这对我很有效。

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

字符串
“Python eggs是Python的一种旧的分发格式。新的格式被称为Python wheel[...] egg文件基本上是一个具有不同扩展名的zip文件。Python可以直接从egg导入。”

ajsxfq5m

ajsxfq5m2#

我的RHEL也遇到了同样的问题。这帮助我克服了错误:
1.在终端中输入pip list
1.找到setuptools的版本。
1.如果setuptools版本大于58,请使用命令pip install setuptools==57.0.0将其设置为小于58
1.之后,我尝试安装pyObex,这又给了我一个与Python.h相关的错误。
1.运行以下命令安装python-dev所需的库:yum install python3-devel(如果您在Ubuntu或其他发行版上,请使用apt-get)
1.运行此命令以安装蓝牙软件包yum install libbluetooth-dev。(如果您在Ubuntu或其他发行版上,请使用apt-get)
1.如果第6步出现错误,请运行此步骤,而不是yum install bluez-libs-devel
1.现在可以安装pip install PyOBEX

相关问题