小编gun*_*ner的帖子

没有名为“picamera”的模块

我跟着这个网站(https://www.pyimagesearch.com/2015/03/30/accessing-the-raspberry-pi-camera-with-opencv-and-python/)来设置我的picamera,但我有一个问题使用 picamera 模块。我确实安装了 picamera 模块,这张图片来自 pip freeze。

https://imgur.com/a/3y5b2rO

你可以看到我已经有 picamera 1.13,但是当我尝试 test_image.py 时,它说“没有名为‘picamera’的模块”。

https://imgur.com/a/XMEXwXJ

我已经卸载并安装了很多次,但错误仍然存​​在。我该如何解决?

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 …
Run Code Online (Sandbox Code Playgroud)

python raspberry-pi

5
推荐指数
2
解决办法
9097
查看次数

标签 统计

python ×1

raspberry-pi ×1