pyskell / slouchy

Slouchy uses your webcam to check if you're slouching and alert you if you are.
GNU General Public License v3.0
800 stars 47 forks source link

Mac build fail #11

Closed LukyVj closed 8 years ago

LukyVj commented 8 years ago

Hi, I tried to run your wonderful project, but once I run python slouchy.py I got this error message :

Traceback (most recent call last):
  File "slouchy.py", line 8, in <module>
    from config import setup
  File "/Users/lucasbonomi/Sites/projects/python/slouchy/config.py", line 4, in <module>
    from main import video_device, calculate_c_squared, take_picture, detect_face
  File "/Users/lucasbonomi/Sites/projects/python/slouchy/main.py", line 1, in <module>
    import cv2
ImportError: dlopen(/usr/local/lib/python2.7/site-packages/cv2.so, 2): Library not loaded: /usr/local/lib/libpng16.16.dylib
  Referenced from: /usr/local/Cellar/opencv/2.4.12/lib/libopencv_highgui.2.4.dylib
  Reason: Incompatible library version: libopencv_highgui.2.4.dylib requires version 35.0.0 or later, but libpng16.16.dylib provides version 34.0.0

Not really sure how I should fix this.

pyskell commented 8 years ago

As per your error message it looks like libpng needs to be upgraded to v 35.0.0. I'm not sure how to do this on Mac.

Try googling the "Reason:" line. Or Googling for "update libpng mac".

adrianhust commented 8 years ago

http://stackoverflow.com/questions/28124359/error-with-homebrew-opencv-libpng

this link may give you some hints

adrianhust commented 8 years ago

I do like this: brew uninstall libpng sudo brew upgrade if some errors occur, you may need to retry

then brew install libpng It works for me

datajungler commented 8 years ago

I have tried to reinstall the libpng and upgrade to version: 1.6.19 under MacOS

The error still occurs: ImportError: dlopen(./cv2.so, 2): Library not loaded: /usr/local/lib/libpng16.16.dylib Referenced from: /usr/local/Cellar/opencv/2.4.12/lib/libopencv_highgui.2.4.dylib Reason: Incompatible library version: libopencv_highgui.2.4.dylib requires version 35.0.0 or later, but libpng16.16.dylib provides version 34.0.0

lijingpeng commented 7 years ago

I have the same problem: ImportError Traceback (most recent call last)

in () ----> 1 import cv2 ImportError: dlopen(/usr/local/lib/python2.7/site-packages/cv2.so, 2): Library not loaded: /usr/local/opt/libpng/lib/libpng16.16.dylib Referenced from: /usr/local/Cellar/opencv/2.4.13/lib/libopencv_highgui.2.4.dylib Reason: Incompatible library version: libopencv_highgui.2.4.dylib requires version 40.0.0 or later, but libpng16.16.dylib provides version 36.0.0
pyskell commented 7 years ago

These are issues with the mac libraries. I don't have a mac so I'm unable to provide additional help. I recommend looking into the cv2 libraries on mac