Ask Your Question
1

Installing OpenCV with Anaconda on OS X

asked Feb 13 '14

link gravatar image

Hello,

I have tried to install OpenCV multiple times over the past couple of days, via both homebrew and from source. I have tried following recipes such as the following, all to no avail.

No matter what I seem to do, I seem to segfault (segmentation fault 11) whenever I try to import OpenCV in python.

I have:

  • OS X 10.9.1
  • conda 3.0.3
  • Python 2.7.6 :: Anaconda 1.9.0 (x86_64)
  • the command line tools for OS X, including gcc, etc.
  • cmake (might be the homebrew version) -- unclear if that matters

I would appreciate any suggestions or recommendations as to how to determine where the error is (as a segmentation fault is not a very instructive error), and then how to go about correcting it.

Preview: (hide)

Comments

Also having trouble with this. Anyone with a recent solution? (On Mac OS 10.9, Anaconda 1.9, Python 2.7.6)

tabchas gravatar imagetabchas (Mar 10 '14)edit

1 answer

Sort by » oldest newest most voted
1

answered May 8 '14

krader gravatar image

There is a pre-built conda package available via

conda install -c https://conda.binstar.org/jjhelmus opencv

It does want to downgrade numpy to version 1.7.1 from the current (as I type this) version 1.8.2 so I first cloned my ipython2 environment:

conda create -n opencv --clone ip2

Then I activated the opencv environment before doing the install above. There is also a conda install recipe at https://github.com/conda/conda-recipes/tree/master/opencv which looks reasonable and would probably allow someone to build opencv against the most current numpy version but I didn't try using it. There is also a discussion thread at https://gist.github.com/welch/6468594 with instructions that look like they should work but, again, I didn't try them in preference to the simple "conda install" above.

Preview: (hide)

Comments

How do I activate the opencv environment? ... When I entered conda create -n opencv --clone ip2 I received Error: could not find environment: ip2

What do i need to do? Thanks!

bonniet gravatar imagebonniet (May 24 '15)edit

The --clone option is cloning an existing environment called ip2. You probably don't have one called ip2. To make a new environment called opencv which is initially a clone of your base environment try conda create -n opencv --clone ~anaconda. To access it: source activate opencv. To go back to your base environment: source deactivate. Everything you do (e.g. install) while in the opencv environment will not affect the base environment.

Here are the docs for conda (specifically the faq for environments): http://conda.pydata.org/docs/faq.html... ...and here's a nice cheat sheet: https://gist.github.com/qheuristics/8...

kungfujam gravatar imagekungfujam (Jul 28 '15)edit

Question Tools

Stats

Asked: Feb 13 '14

Seen: 7,623 times

Last updated: May 07 '14