dqpi
Posts: 33
Joined: Fri May 24, 2013 12:22 pm

picamera and b2

Wed Feb 04, 2015 11:01 am

Code: Select all

import picamera

with picamera.PiCamera() as camera:
    camera.resolution = (640, 480)
    camera.start_recording('my_video.h264')
    camera.wait_recording(60)
    camera.stop_recording()
When i run this code on the B2, I get the following error:

Traceback (most recent call last):
File "test.py", line 1, in <module>
import picamera
File "/usr/lib/python2.7/dist-packages/picamera/__init__.py", line 269, in <module>
from picamera.camera import PiCamera
File "/usr/lib/python2.7/dist-packages/picamera/camera.py", line 83, in <module>
import RPi.GPIO as GPIO
RuntimeError: This module can only be run on a Raspberry Pi!

I installed picamera again. Is anyone else experiencing this problem on the B2? Should the library be compatible? In case so, I know I am doing something wrong:)

DirkS
Posts: 10416
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: picamera and b2

Wed Feb 04, 2015 11:06 am

RPi.GPIO needs an update.
In the other topic you posted in there's a response from Ben Croston: http://www.raspberrypi.org/forums/viewt ... 80#p683480

dqpi
Posts: 33
Joined: Fri May 24, 2013 12:22 pm

Re: picamera and b2

Wed Feb 04, 2015 11:31 am

Great that worked. Thank you!

Sorry for not missing the post (thought it was a picamera problem instead of a GPIO)

Return to “Camera board”