Ask Your Question
0

Error in Running Tutorial/Example Code

asked 2014-01-15 14:59:20 -0500

noobcoder gravatar image

updated 2014-01-15 19:42:52 -0500

Here is the error:

NotImplementedError: font module not available
(ImportError: dlopen(/Library/Python/2.7/site-packages/pygame/font.so, 2): Library not loaded: /usr/local/lib/libfreetype.6.dylib
Referenced from: /usr/local/lib/libSDL_ttf-2.0.0.dylib
Reason: Incompatible library version: libSDL_ttf-2.0.0.dylib requires version 18.0.0 or later, but libfreetype.6.dylib provides version 14.0.0)

I do not know how to use libSDL_ttf/libfreetype and was wondering what I have to do to fix this issue. Thanks.

Edit: *When I was able to run by just typing simpleCV and then going through the examples, some of them would work and others wouldn't, giving the error above. Now, when I even type simpleCV, it says.

ImportError: Cannot load OpenCV library which is required by SimpleCV

I'm not even sure which OpenCV to re-install anymore, its very confusing

edit retag flag offensive close merge delete

Comments

what is your operating system?

Rodrigo gomes gravatar imageRodrigo gomes ( 2014-01-15 17:29:28 -0500 )edit

Latest Mac OS. I figured out its a problem with pygame but haven't figured any solution past that

noobcoder gravatar imagenoobcoder ( 2014-01-15 18:50:35 -0500 )edit

1 Answer

Sort by » oldest newest most voted
0

answered 2014-01-16 08:23:02 -0500

updated 2014-01-16 08:35:06 -0500

you must first install opencv, if already installed do a test, open the terminal and type python:

import cv

if two commands present errors is because the opencv installation is corrupted.

then hands dirty!

Open Applications > Utilities > Terminal… Install Homebrew by typing the following into Terminal:

Install homebrew

Run the command brew doctor to check for any errors While normal installations using Homebrew are very straightforward, for some reason OpenCV requires an extra step – you need to install an add-on called science:

  • brew tap homebrew/science

Then you can run the usual Homebrew command to install OpenCV:

  • brew install opencv

If this fails, it may be that you have ffmpeg installed – if so, try this instead:

  • brew install opencv --env=std

This may take several minutes, so be patient! Homebrew may tell you that you have to update PYTHONPATH – if so, open your favorite text editor, click File > Open… and hit command+shift+. to see hidden files Navigate up to your home folder and open the .bash_profile file – if it doesn’t exist, create it yourself Add the line suggested by Homebrew, probably something like:

  • export PYTHONPATH=/usr/local/lib/python2.7/site-packages:$PYTHONPATH

Save the file and close it – you may also have to exit Terminal and open it again Test by opening Python:

  • python

Then try to import OpenCV:

import cv

If you don’t get any errors, you’re all set!

edit flag offensive delete link more

Comments

Thank you for the response. When I type import cv, I get the standard import error for python modules. I followed your instructions but it says: Warning: Already tapped! Warning: opencv-2.4.7.1 already installed. I'm sure if I fix some path somewhere it can be fixed.

noobcoder gravatar imagenoobcoder ( 2014-01-16 12:58:25 -0500 )edit

But the main issue for me isn't the OpenCV, its the incompatability in the OP: Reason: Incompatible library version: libSDL_ttf-2.0.0.dylib requires version 18.0.0 or later, but libfreetype.6.dylib provides version 14.0.0)

noobcoder gravatar imagenoobcoder ( 2014-01-16 12:59:29 -0500 )edit

try import cv2 ???

Rodrigo gomes gravatar imageRodrigo gomes ( 2014-01-16 18:01:28 -0500 )edit

import cv2 doesn't work either. i appreciate all the help but i will just revisit this another time

noobcoder gravatar imagenoobcoder ( 2014-01-18 02:19:33 -0500 )edit

Can someone post the virtual box image used at the PyCon 2013 conference? Would love to have a working version of SimpleCV that really works in IPython notebook. Instead, I can launch notebook but image.save(display) does not display inline and crashes the program.

LeslieK gravatar imageLeslieK ( 2014-01-25 22:31:56 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2014-01-15 14:59:20 -0500

Seen: 559 times

Last updated: Jan 16 '14