- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我是Docker的新手,所以可能我做错了什么。我正在尝试在容器中安装Adafruit-GPIO
,但我一直收到此错误,并且不确定如何解决。我正在使用Powershell在Windows 10 pc上本地构建文件。
我已经确保正确安装了GCC。我一直在网上寻找答案,没有什么可做的。
Dockerfile:
FROM balenalib/raspberry-pi-debian-python:3.7.2
RUN pip3 install --upgrade pip
RUN sudo pip3 install --upgrade setuptools
RUN sudo apt-get update && apt-get -y install gcc
RUN pip3 install adafruit-gpio
ERROR: Complete output from command /usr/local/bin/python3.7 -u -c 'import setuptools, tokenize;__file__='"'"'/tmp/pip-install-qfol0jyh/spidev/setup.py'"'"';f=getattr(tokenize, '"'"'open'"
'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-i37a5wvt/install-record.txt -
-single-version-externally-managed --compile:
ERROR: running install
running build
running build_ext
building 'spidev' extension
creating build
creating build/temp.linux-armv6l-3.7
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/usr/local/include/python3.7m -c spidev_module.c -o build/temp.linux-armv6l-3.7/spidev_module.o
In file included from /usr/lib/gcc/arm-linux-gnueabihf/6/include-fixed/syslimits.h:7:0,
from /usr/lib/gcc/arm-linux-gnueabihf/6/include-fixed/limits.h:34,
from /usr/local/include/python3.7m/Python.h:11,
from spidev_module.c:28:
/usr/lib/gcc/arm-linux-gnueabihf/6/include-fixed/limits.h:168:61: fatal error: limits.h: No such file or directory
#include_next <limits.h> /* recurse down to the real one */
^
compilation terminated.
error: command 'gcc' failed with exit status 1
----------------------------------------
ERROR: Command "/usr/local/bin/python3.7 -u -c 'import setuptools, tokenize;__file__='"'"'/tmp/pip-install-qfol0jyh/spidev/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);cod
e=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-i37a5wvt/install-record.txt --single-version-external
ly-managed --compile" failed with error code 1 in /tmp/pip-install-qfol0jyh/spidev/
最佳答案
安装build-essential
替换gcc
可能会使您工作,请参阅official git。
实际上,在构建一些源代码时,始终最好安装build-essential
,因为它不仅会安装gcc
,还会安装一些dev软件包。您的错误fatal error: limits.h: No such file or directory
只是因为错过了这些dev软件包。
总之,next将为您工作:
RUN sudo apt-get update && apt-get -y install build-essential
关于docker - 如何在Docker中安装Adafruit-GPIO库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56653515/
虽然找到了许多关于如何使用 GPIO.BCM 模式设置 gpio 的示例(其中引脚编号等效于 RPI(参见图像和 nvidia/jetson-gpio),但我找不到在 GPIO.TEGRA_SOC 模
我一直在努力编写一个脚本,该脚本将 Pi 的 BCM 引脚 17、27 和 10 打开 1 秒,然后关闭 1 秒,连续 100 次。当我运行脚本时,LED1 会亮起然后熄灭,程序因以下错误而关闭: T
我想使用 linux GPIO 驱动程序来处理 mpc8308 处理器的 GPIO 引脚之一作为输出。所以我启用了 GPIO 驱动程序并在以下位置进行调试: Device Drivers ---> G
我正在开发一个项目,需要我配置 GPIO 引脚并向原子板添加传感器。内核已配置 gpio ... CONFIG_GPIO_SYSFS=y 是内核选项之一。 我使用的是fedora版本2.6.29-10
我真的很担心我的 GPIO 可能被烧坏了,因为即使是这个 super 简单的代码也会导致错误 import RPi.GPIO as io import time io.setmode(io.BCM)
我尝试将 RPi.GPIO 与 Python 3.6 一起使用。 我安装了 RPi.GPIO,它适用于 Python 3.4,但不适用于 Python 3.6 我得到这个错误: ModuleNotFo
默认情况下,/sys/class/gpio 只能作为 root 访问。所以我喜欢一个新组gpio可以使用/sys/class/gpio下的文件和目录。为此,我将以下行添加到 /etc/rc.local
我已经阅读了 RPi.GPIO 的文档,并在谷歌和 SO 上进行了搜索,但无法完全找到可能是一个非常愚蠢的问题的解决方案。我试图只检测按下按钮的边缘。但无论我是否指定寻找“下降”或“上升”边缘,Pi
我正在编写一个程序来读取 GPIO 引脚的温度。不幸的是,访问这些总是会抛出 ModuleNotFoundError:没有名为“RPi”的模块。 我尝试重新安装它们,但没有成功。 异常(excepti
我正在使用 Raspberry pi 和 java 来使用 pi4j 使 LED 闪烁,一切都已清除并且工作正常,LED 按照代码闪烁但是当我第二次运行时它会导致以下错误,我搜索了很多有很多相同的问题
所以我一直在尝试通过使用命令行和 sysfs 写入和读取 /sys/class/gpio/ 让我的 Raspberry Pi GPIO 正常运行。根据以下教程,我无法复制将 GPIO 设置为输出并将其
我正在使用 Q7 模块 (x86) 并尝试在 Linux 上使用 ACPI SSDT 覆盖配置我们的外围设备。但我与它斗争。我想我误解了 ACPI 的一些核心概念。 问题 CPU -> I2C ->
我正在尝试在 Raspberry PI 上使用 nodejs 从连接的光传感器读取值。我可以读取 python 程序的读数,并可以确认我的设置是正确的。 下面是程序 var gpio = requir
我正在从事密室逃脱项目。实际上,我试图创建的行为如下: 网络浏览器以通常的方式显示网络应用程序的一部分。从此时起,客户端上将不再有键盘/鼠标的输入。我已经使用 JS 解决了基于时间的更改,因此我可以加
我的代码在使用 raspberry pi 时遇到问题。我刚开始使用 Python,所以我需要一些帮助。 这是代码: import RPi.GPIO as GPIO import time GPIO.s
我遇到了和这个问题一样的问题, python import fails when called from PHP但现在是我的另一个导入。 脚本在命令行 (python uit.py) 和一个 test
现在使用旧方法 gpio-sunxi 如何在 OrangePi PC plus ( SoC H3 ) 上访问 Armbian 3.4.113 上的 GPIO并编辑 .fex -file 已过时(想分享
在 Android 和 Linux 下使用传统的 sysfs GPIO 过程的第一步是脚趾 export您要使用的特定 GPIO 引脚。当您完成 GPIO 引脚到 unexport它。 我一直在寻找关
PHYTEC 的内核版本 3.12.30-AM335x-PD15.1.1。 如果我使用/sys/class/gpio 方式,我可以看到按钮输入引脚(AM3359 的 gpio103)值从 0 变为 1
从以前已知的 sysfs 接口(interface),任何人都可以设置合理配置的 GPIO 线的输出,并且此输出将保持该值,直到 SoC 重置或有人更改线值。使用 GPIOlib,当消费者关闭 gpi
我是一名优秀的程序员,十分优秀!