我关注了这个网站(https://www.pyimagesearch.com/2015/03/30/accessing-the-raspberry-pi-camera-with-opencv-and-python/)来设置我的picamera,但是我的picamera模块有一个问题。我确实安装了picamera模块,这张图片来自pip freeze。
你可以看到我已经有了picamera1.13,但是当我尝试test_image.py时,它显示“没有名为‘picamera’的模块”。
我已经卸载并安装了很多次,但错误仍然存在。我该如何解决这个问题?
test_image.py
# import the necessary packages
from picamera.array import PiRGBArray
from picamera import PiCamera
import time
import cv2
# initialize the camera and grab a reference to the raw camera capture
camera = PiCamera()
rawCapture = PiRGBArray(camera)
# allow the camera to warmup
time.sleep(0.1)
# grab an image from the camera
camera.capture(rawCapture, format="bgr")
image = rawCapture.array
# display the image on screen and wait for a keypress
cv2.imshow("Image", image)
cv2.waitKey(0)发布于 2019-09-16 18:00:17
对于python3,你只需要在commands.keep下面尝试一下,记住你需要在主目录中打开终端。
sudo -H apt install python3-picamera
sudo -H pip3 install --upgrade picamera[array]如果有效,请让我知道!
发布于 2019-05-11 21:40:30
当您运行命令pip3 install picamera时,如果您已经安装了picamera,它将显示该要求已经满足,后跟一个路径。现在复制该路径并将其包含在程序中,如下所示:
import sys
sys.path.append('paste the copied path here')
from picamera.array import PiRGBArray
from picamera import PiCamera发布于 2020-05-02 17:30:14
我也面临着同样的问题,直到我注意到我在PiCamera中没有将c大写
https://stackoverflow.com/questions/55028280
复制相似问题