Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/opencv/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 在Rasperberry Pi 4上安装OpenCV_Python_Opencv_Raspberry Pi - Fatal编程技术网

Python 在Rasperberry Pi 4上安装OpenCV

Python 在Rasperberry Pi 4上安装OpenCV,python,opencv,raspberry-pi,Python,Opencv,Raspberry Pi,我试图在我的rasperberry pi 4上安装OpenCV,但它给了我很多错误 pi@raspberrypi:~$sudo dphys swapfile swapoff sudo:dphys:未找到命令 pi@raspberrypi:~$apt get安装dphys交换文件 E:无法打开锁文件/var/lib/dpkg/lock frontend-打开(13:权限被拒绝) E:无法获取dpkg前端锁(/var/lib/dpkg/lock frontend),您是root用户吗? pi@ras

我试图在我的rasperberry pi 4上安装OpenCV,但它给了我很多错误

pi@raspberrypi:~$sudo dphys swapfile swapoff
sudo:dphys:未找到命令
pi@raspberrypi:~$apt get安装dphys交换文件
E:无法打开锁文件/var/lib/dpkg/lock frontend-打开(13:权限被拒绝)
E:无法获取dpkg前端锁(/var/lib/dpkg/lock frontend),您是root用户吗?
pi@raspberrypi:~$sudo apt获取更新
点击:1http://archive.raspberrypi.org/debian 爆破冲击波
点击:2http://raspbian.raspberrypi.org/raspbian 爆破冲击波
正在阅读软件包列表。。。多恩
pi@raspberrypi:~$sudo apt get安装dphys交换文件
正在阅读软件包列表。。。多恩
构建依赖树
正在读取状态信息。。。多恩
dphys交换文件已经是最新版本(20100506-5+rpt2)。
以下软件包已自动安装,不再需要:
alsa base freetype2文档gconf服务gconf2通用gstreamer0.10-alsa gstreamer0.10-plugins-base libdrm-etnaviv1 libexiv1-14 libgconf-2-4 libgfortran3 libgmime-2.6-0 libgstreamer-plugins-base0.10-0 libgstreamer0.10-0 libllvm6.0
libmicrodns0 libncurses5 libpng工具libva-wayland2 libxfce4util bin libxfce4util公共libxfce4util7 libxfce4util7 libxfconf-0-2 lxplug卷pimixer point rpi python3 pyperclip uuid dev xfconf
使用“sudo apt autoremove”删除它们。
0已升级,0已新安装,0已删除,0未升级。
1未完全安装或拆除。
执行此操作后,将使用0 B的额外磁盘空间。
你想继续吗?[Y/n]Y
设置dphys交换文件(20100506-5+rpt2)。。。
dphys-swapfile.service的作业失败,因为控制进程已退出,并显示错误代码。
有关详细信息,请参阅“systemctl status dphys swapfile.service”和“journalctl-xe”。
调用rc.d:initscript dphys swapfile,操作“重启”失败。
\u25cf dphys-swapfile.service-dphys swapfile-设置、装载/卸载和删除交换文件
已加载:已加载(/lib/systemd/system/dphys-swapfile.service;已启用;供应商预设:已启用)
激活:自美国东部夏令时2021-05-19周三06:23:28起失败(结果:退出代码);27毫秒前
医生:男:dphys交换文件(8)
进程:6025 ExecStart=/sbin/dphys交换文件设置(代码=退出,状态=0/成功)
进程:6048 ExecStart=/sbin/dphys交换文件swapon(代码=退出,状态=255/异常)
主PID:6048(代码=退出,状态=255/异常)
May 19 06:23:28 raspberrypi systemd[1]:启动dphys交换文件-设置、装载/卸载和删除交换文件。。。
May 19 06:23:28 raspberrypi dphys交换文件[6025]:want/var/swap=2048MByte,检查现有:保留
May 19 06:23:28 raspberrypi dphys交换文件[6048]:swapon:/var/swap:swapon失败:参数无效
May 19 06:23:28 raspberrypi systemd[1]:dphys-swapfile.service:主进程已退出,代码=退出,状态=255/异常
May 19 06:23:28 raspberrypi systemd[1]:dphys-swapfile.service:失败,结果为“退出代码”。
May 19 06:23:28 raspberrypi systemd[1]:无法启动dphys交换文件-设置、装载/卸载和删除交换文件。
dpkg:处理包dphys交换文件时出错(--configure):
已安装的dphys交换文件包安装后脚本子流程返回错误退出状态1
处理时遇到错误:
dphys交换文件
E:子流程/usr/bin/dpkg返回错误代码(1)
pi@raspberrypi:~ $ 

如果有人能分享我错过或需要采取的步骤,我将不胜感激

这个问题实际上并不清楚。你最好在youtube上继续学习教程,你会学好的。也许这个线程有帮助?正确的命令是dphys swapfile swapoff。。您缺少一个连字符。。但无论如何,这与opencv安装有什么关系?