【问题标题】:How to install python3-lgpio on Ubuntu 20.04 on a Raspberry Pi如何在 Raspberry Pi 上的 Ubuntu 20.04 上安装 python3-lgpio
【发布时间】:2022-01-29 09:15:18
【问题描述】:

我正在关注How to use the Raspberry Pi GPIO headers with ubuntu 上的教程,其中一个步骤是使用安装 python3-lgpio

sudo apt install python3-lgpio 

我得到E: Unable to locate package python3-lgpio 作为结果。
我尝试手动定位软件包 from here 并使用 sudo dpkg -i python3-lgpio 手动安装它,我得到了

dpkg: dependency problems prevent configuration of python3-lgpio:
python3-lgpio depends on python3 (>= 3.9~); however:
Version of python3 on system is 3.8.2-0ubuntu2.

但是,python -V 输出 Python 3.9.10,因为我之前在 Pi 上更新了 python。

【问题讨论】:

    标签: ubuntu raspberry-pi python-3.9 dpkg


    【解决方案1】:

    我也遇到了这个问题,但最终得到了一个丑陋的解决方法。我加载了 RPi.GPIO (https://pypi.org/project/RPi.GPIO/) 并按照https://sourceforge.net/p/raspberry-gpio-python/wiki/BasicUsage/ 的使用说明进行操作

    我能够使用 IDLE 打开和关闭 LED。我确实必须使用 sudo 安装模块并使用 sudo 运行 IDLE。呸!绝对是一个 hack,我会关注这个,看看是否有人在 20.04 有更好、更正确的方法来访问 GPIO。

    【讨论】:

      猜你喜欢
      • 2020-08-13
      • 2020-09-30
      • 2020-12-13
      • 2021-10-17
      • 2021-03-22
      • 2020-10-10
      • 1970-01-01
      • 2021-07-03
      • 2021-08-23
      相关资源
      最近更新 更多