1
votes

I am trying to use picamera to do a video streaming on my Mac(python 2.7). I have installed picamera by this command:

(venv)55-213:video_streaming mreko$ pip install picamera

Requirement already satisfied (use --upgrade to upgrade): picamera in ./venv/lib/python2.7/site-packages

Then I wrote a py script trying to test the picamera:

import time
import picamera
with picamera.PiCamera() as camera:
       camera.resolution = (1024, 768)
       camera.start_preview()
       # Camera warm-up time
      time.sleep(2)
      camera.capture('foo.jpg')

However,when I compile this py script,it throws an error:

(venv)55-213:video_streaming mreko$ python test.py


Traceback (most recent call last): File "test.py", line 2, in import picamera File "/Users/mreko/python_workstation/video_streaming/venv/lib/python2.7/site-packages/picamera/__init__.py", line 258, in from picamera.exc import ( File "/Users/mreko/python_workstation/video_streaming/venv/lib/python2.7/site-packages/picamera/exc.py", line 41, in import picamera.mmal as mmal File "/Users/mreko/python_workstation/video_streaming/venv/lib/python2.7/site-packages/picamera/mmal.py", line 47, in _lib = ct.CDLL('libmmal.so') File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ctypes/__init__.py", line 365, in __init__ self._handle = _dlopen(self._name, mode) OSError: dlopen(libmmal.so, 6): image not found

I know the extention of lib on mac is 'dylib'.I change 'libmmal.so' into 'libmmal.dylib'.However,still it can't work.

Then I search the /usr/lib/,I found there is no dylib name 'libmmal'.

So I don't know how to solve this problem.Maybe the picamera can't support Mac? Or is there any way that I can intall libmmal.dylib file to support the picamera?

It really makes me upset!! Thanks a lot!

1
You connected a Raspberry Pi camera module to your Mac??? - Klaus D.
yes,cause I want to do a live video streaming.I want to use picamera module to catch the picture of the camera. - Eko Lee
I am no aware that any Mac has a CSI interface. So how did you do that? - Klaus D.

1 Answers

1
votes

The files that picamera is referencing are part of the raspberry firmware and you would need to recompile them for your mac.

As others asked in the comments, are you sure you have connected the thin flexband of the camera to your apple laptop? If so, how? If not, are you running a raspberry pi and connecting to it via your mac?