【问题标题】:how to find python-mosquitto version如何找到 python-mosquitto 版本
【发布时间】:2013-11-14 10:28:33
【问题描述】:

如何查看我的程序使用的 python-mosquitto 包的版本?如何找到旧版本的 python-mosquitto(0.15 版)并删除它?

我在树莓派上运行,raspian

【问题讨论】:

    标签: python raspberry-pi mqtt mosquitto


    【解决方案1】:

    0.15 是 raspbian 默认存储库提供的版本,所以我认为您是通过包管理器而不是 pip 安装的。

    假设是这种情况,您可以使用sudo apt-get remove python-mosquitto 将其删除。您可以从 mosquitto 存储库中获取最新版本,您可以按如下方式添加:

    # Add the gpg signing key for the repository
    wget http://repo.mosquitto.org/debian/mosquitto-repo.gpg.key
    sudo apt-key add mosquitto-repo.gpg.key
    
    # Add the repository url and details to list of sources
    cd /etc/apt/sources.list.d/
    sudo wget http://repo.mosquitto.org/debian/mosquitto-wheezy.list
    

    然后更新并安装:

    sudo apt-get update
    sudo apt-get install python-mosquitto
    

    这还将为您提供其他 mosquitto 组件的更新包。

    您也可以使用 pip 安装:pip install mosquitto

    当前版本的 mosquitto.py 不包含版本号,但已针对未来版本进行了修复。

    【讨论】:

      【解决方案2】:

      如果您使用pip,请使用pip freeze | grep 'python-mosquitto' 获取软件包版本,并使用pip remove python-mosquitto 删除它。

      【讨论】:

        猜你喜欢
        • 2023-03-28
        • 2021-05-15
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2016-03-13
        • 2014-05-28
        相关资源
        最近更新 更多