0

I am trying to take a picture using my Raspberry Pi 3 & Raspberry Pi Camera from the terminal of my Mac laptop. I connect through SSH w/my IP address, then enter Python, then:

>>> import picamera
>>> camera = picamera.PiCamera()

After entering this the camera light comes on.

>>> camera.capture = (“test_image.jpg”)

After entering this I get the following error:

AttributeError: 'PiCamera' object attribute 'capture' is read-only

I get no errors using camera.capture(“test_image.jpg”) in Python on Raspian.

How do I enable the Mac write privileges for camera.capture, if that’s what I need to do? I know it must be something simple, but just haven’t found the right keywords to search.

  • 1
    Are you after a solution to your Python problem, or a solution to take pictures? The inbuilt raspistill command should do what you want. – Milliways Dec 19 '16 at 1:40
  • I was trying to take a photo remotely & import it to my mac using ssh. Sorry that wasn't clear. Total Noobie & made a typo. Problem solved. Thanks for your suggestion. – benji7 Dec 20 '16 at 1:10
1

Working directly on the Pi you enter:

camera.capture("test_image.jpg")

Working though the SSH session from your Mac you enter:

camera.capture = ("test_image.jpg") 

Notice the = sign in the line you entered on Mac. This results in an error, because you try to assign value to the capture() method of the PiCamera object.

SSH connection plays no role here. Everything you enter is executed and interpreted on the Pi.

  • Yes, thank you for pointing that out. That's exactly what was wrong. – benji7 Dec 20 '16 at 1:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.