python-broadlink插件setup.py在树莓派64位2025-12-04最新版和domoticz 25.2版安装报错

安装、编译、权限、安全和启动问题请在此发帖提问。
版面规则
安装、编译、权限、安全和启动问题请在此发帖提问。
有问题请说明详细情况,有图的截图!
别只说一句安装不上,执行不了!
截图请截大图,别就截一行。。。
回复
flyiingtt
帖子: 28
注册时间: 周三 6月 21, 2017 22:55

python-broadlink插件setup.py在树莓派64位2025-12-04最新版和domoticz 25.2版安装报错

帖子 flyiingtt »

Pi 3B+ 安装了Raspberry Pi OS lastest 2025-12-04 和 domoticz 25.2.成功安装了 python3-broadlink/stable,stable,now 0.19.0-1 all [installed]
我从zak-45的GitHub页面下载了Broadlink-Domoticz-plugin-main.zip 然后在Broadlink目录运行 setup.py报错失败


错误1: cgitb not working
查到的原因: Python 3.13.5 not supporting it anymore.
根据建议注释掉了这两句 import cgitb 和 cgitb.enable(format='text') ,然后脚本可以继续进行

错误2:输入domoticz的地址和端口号进行连接时,因为新版的需要用户密码登录,所以脚本连不上失败。我自己解决了,临时启动domoticz在不需要密码登录的状态。

错误3:
# we install necessary modules
----------------------------------------
-*-
We execute this command : sudo -H python -m pip install cryptography==36.0.0
error: externally-managed-environment

× This environment is externally managed
╰─> To install Python packages system-wide, try apt install
python3-xyz, where xyz is the package you are trying to
install.

If you wish to install a non-Debian-packaged Python package,
create a virtual environment using python3 -m venv path/to/venv.
Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
sure you have python3-full installed.

For more information visit http://rptl.io/venv

note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification.
ERROR to start subprocess
1
sudo -H python -m pip install cryptography==36.0.0
b''
ERROR to install : cryptography==36.0.0
could be normal if already exist, continue in anyway....

后面还有很多类似的安装错误就不全粘贴了。查到的原因: 因为 Raspberry Pi OS Bookworm 及以上版本禁止了 pip 全局安装,必须使用系统 apt 包或 Python 虚拟环境。 豆包给的一些其他方法也试过没有用。

请Zak帮忙看看如何能成功安装。
多谢
头像
DT27
帖子: 347
注册时间: 周四 3月 30, 2017 08:54
Gender:

Re: python-broadlink插件setup.py在树莓派64位2025-12-04最新版和domoticz 25.2版安装报错

帖子 DT27 »

用Docker吧,Docker 里python版本是3.11.2,可以成功pip install cryptography==36.0.0
头像
DT27
帖子: 347
注册时间: 周四 3月 30, 2017 08:54
Gender:

Re: python-broadlink插件setup.py在树莓派64位2025-12-04最新版和domoticz 25.2版安装报错

帖子 DT27 »

我的Docker Compose供你参考
/mnt/user/myConfig/domoticz/userdata为宿主机目录
docker.1ms.run/为docker国内可用镜像

代码: 全选

services:
  domoticz:
    container_name: domoticz
    image: docker.1ms.run/domoticz/domoticz
    ports:
      - 4443:443/tcp
      - 8880:8080/tcp
    environment:
      TZ: Asia/Shanghai
      LOG_PATH: /opt/domoticz/userdata/domoticz.log
      WWW_PORT: '8080'
      SSL_PORT: '443'
    volumes:
      - /mnt/user/myConfig/domoticz/userdata:/opt/domoticz/userdata
    network_mode: bridge

回复