使用pip 22.2安装bluepy失败求助(Python3.9.10环境)
安装bluepy报错的解决方法
问题背景
已安装Python 3.9.10和pip 22.2,执行pip3 install bluepy时持续报错,错误输出如下:
C:\Users\User>pip3 install bluepy Collecting bluepy Using cached bluepy-1.3.0.tar.gz (217 kB) Preparing metadata (setup.py) ... done Using legacy 'setup.py install' for bluepy, since package 'wheel' is not installed. Installing collected packages: bluepy Running setup.py install for bluepy ... error error: subprocess-exited-with-error × Running setup.py install for bluepy did not run successfully. │ exit code: 1 ╰─> [8 lines of output] H:\Python39\lib\site-packages\setuptools\dist.py:717: UserWarning: Usage of dash-separated 'description-file' will not be supported in future versions. Please use the underscore name 'description_file' instead warnings.warn( running install running build running build_py error: [WinError 2] The system cannot find the file specified Working dir is C:\Users\User\AppData\Local\Temp\pip-install-zj6bo4s8\bluepy_8c28c6c23a27424498856c30a119129d execute make -C ./bluepy clean [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. error: legacy-install-failure × Encountered error while trying to install package. ╰─> bluepy note: This is an issue with the package mentioned above, not pip. hint: See above for output from the failure. C:\Users\User>
已尝试的无效操作
- 参考过Stack Overflow相似问题的解决方案,未生效
- 重装过Python和pip,问题依然存在
- 已通过Visual Studio Installer安装如下组件:

可行解决方向
1. 安装make工具
报错提示execute make -C ./bluepy clean找不到文件,说明Windows环境缺少make命令,可通过以下方式补充:
- 安装MinGW-w64,勾选
mingw32-make组件,将MinGW的bin目录(如C:\MinGW\bin)添加到系统环境变量PATH,再把mingw32-make.exe重命名为make.exe - 安装Git for Windows,其自带
make工具,安装时选择将Git添加到系统PATH,重启命令行即可使用
2. 安装wheel包避免legacy安装方式
先执行pip install wheel,再尝试安装bluepy:pip3 install bluepy,规避旧版setup.py install的安装逻辑
3. 补齐Windows蓝牙开发依赖
bluepy依赖蓝牙相关开发库,Windows环境需确认:
- 已安装最新蓝牙驱动
- 蓝牙服务(Bluetooth Support Service)处于运行状态
- 在Visual Studio Installer中添加对应版本的Windows SDK,并勾选蓝牙开发相关组件
4. 更换兼容Windows的替代库
若bluepy安装始终受阻,可尝试使用pybluez替代,执行pip install pybluez即可安装
内容的提问来源于stack exchange,提问作者Jannis
相关产品推荐
相关产品推荐

