甚至可以在 Raspberry Pi 4B 上的 Debian 64 位 (aarch64) Buster 版本操作系统上安装 PiCamera 库吗?

问题描述

我刚刚在 Raspberry Pi 4B 上安装了 64 位 (aarch64) Debian 版本操作系统,并使用以下命令安装了 Picamera 库:

<?xml version="1.0" encoding="utf-8"?> <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent"> <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="top|right" android:layout_marginTop="5dp" android:layout_marginEnd="25dp" android:src="@drawable/ic_baseline_attach_money_24" tools:ignore="RtlHardcoded" android:contentDescription="@string/todo" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_horizontal" android:text="Ian Somerhalder" android:textColor="@color/white" android:layout_marginTop="5dp" android:textSize="20sp" android:textStyle="bold" tools:ignore="SmallSp" /> <TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_gravity="left|center_vertical" tools:ignore="RtlHardcoded" android:textSize="17sp" android:layout_marginLeft="10dp" android:textColor="@color/white" android:text=".............."/> </FrameLayout>

然后使用命令升级:

sudo pip install picamera

但是每当我尝试在导入 Picamera 的地方运行 python 脚本时,它都会抛出以下错误:

sudo pip install -U picamera

我用谷歌搜索了这个问题,发现/opt目录中缺少实际目录和文件,所以不得不升级固件,使用以下命令升级固件后,我确实得到了目录和丢失文件 (/opt/vc/lib),但仍然给出相同的错误:

Traceback (most recent call last): File "speed_estimation_dl.py",line 60,in <module> vs = VideoStream(usePiCamera=True).start() File "/usr/local/lib/python3.7/dist-packages/imutils/video/videostream.py",line 13,in __init__ from .pivideostream import PiVideoStream File "/usr/local/lib/python3.7/dist-packages/imutils/video/pivideostream.py",line 2,in <module> from picamera.array import PiRGBArray File "/home/pi/.local/lib/python3.7/site-packages/picamera/__init__.py",line 72,in <module> from picamera.exc import ( File "/home/pi/.local/lib/python3.7/site-packages/picamera/exc.py",line 41,in <module> import picamera.mmal as mmal File "/home/pi/.local/lib/python3.7/site-packages/picamera/mmal.py",line 49,in <module> _lib = ct.CDLL('libmmal.so') File "/usr/lib/python3.7/ctypes/__init__.py",line 356,in __init__ self._handle = _dlopen(self._name,mode) OSError: libmmal.so: cannot open shared object file: No such file or directory

uname -a

的输出

sudo rpi-upgrade

cat /etc/os-release

的输出
Linux raspberrypi 5.10.48-v8+ #1435 SMP PREEMPT Fri Jul 9 18:23:58 BST 2021 aarch64 GNU/Linux

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)