• Skip to main content
  • Skip to primary sidebar

RNTLab.com

The Ultimate Shortcut to Learn Electronics and Programming with Open Source Hardware and Software

  • Courses
  • Forum
    • Forum
    • Ask Question
  • Shop
  • Account
  • Blog
  • Login

Typo in example for the Guide to Raspberry Pi Camera V2 Module?

Q&A Forum › Category: Raspberry Pi › Typo in example for the Guide to Raspberry Pi Camera V2 Module?
0 Vote Up Vote Down
rajeshsoni1 asked 6 years ago

Hi, for pictures I tried…

from time import sleep
from picamera import PiCamera

camera

= PiCamera()
camera.resolution = (1024, 768)
camera.start_preview()

sleep

(2)
camera.capture('test_photo.jpg')

and for videos…


import picamera

camera

= picamera.PiCamera()

camera

.resolution = (640, 480)
camera.start_recording('test_video.h264')
camera.wait_recording(5)
camera.stop_recording()

 

print('Finished recording')

but both give me the same error, but on different line numbers.

For Photos I get,

Traceback (most recent call last):
File “take_photo.py”, line 6, in <module>
from picamera import PiCamera
ImportError: No module named ‘picamera’

and for videos I get,

Traceback (most recent call last):
File “take_video.py”, line 3, in <module>
import picamera
ImportError: No module named ‘picamera’

 

I have a headless system, just in case this only work with a monitor attached to the Pi.

Question Tags: ptyhon3 raspberry pi v2 camera
1 Answers
0 Vote Up Vote Down
Rui Santos Staff answered 6 years ago

Hello, it looks like you don’t have picamera Python module installed. Install it with the following command:

sudo apt-get install python3-picamera

After that, you can re-run the project and it should work! I hope it works for you.

Primary Sidebar

Login to Ask or Answer Questions

This Forum is private and it’s only available for members enrolled in our Courses.

Login »

Latest Course Updates

  • [New Edition] Build ESP32-CAM Projects eBook – 2nd Edition April 16, 2025
  • [eBook Updated] Learn ESP32 with Arduino IDE eBook – Version 3.2 April 16, 2025

You must be logged in to view this content.

Contact Support - Refunds - Privacy - Terms - MakerAdvisor.com - Member Login

Copyright © 2013-2025 · RandomNerdTutorials.com · All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.