Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is Homebrew not creating python binding files on OS X 10.8?

I'm trying to use OpenCV with PySide on a Mac with Mountain Lion. The Homebrew formula works fine, but the python binding files do not show up.

romaindeterre$ brew install opencv
==> Downloading http://sourceforge.net/projects/opencvlibrary/files/opencv-unix/2.4.3/Op
Already downloaded: /Library/Caches/Homebrew/opencv-2.4.3.tar.bz2
==> cmake -DCMAKE_INSTALL_PREFIX=/usr/local/Cellar/opencv/2.4.3 -DCMAKE_BUILD_TYPE=None 
==> make
==> make install
==> Caveats
The OpenCV Python module will not work until you edit your PYTHONPATH like so:
   export PYTHONPATH="/usr/local/lib/python2.7/site-packages:$PYTHONPATH"

To make this permanent, put it in your shell's profile (e.g. ~/.profile).
==> Summary
/usr/local/Cellar/opencv/2.4.3: 214 files, 51M, built in 108 seconds

The /usr/local/lib/python2.7/site-packages does not contain any file named cv.*.

I did brew update and the output of brew doctor is below :

Warning: "config" scripts exist outside your system or Homebrew directories. ./configure scripts often look for *-config scripts to determine if software packages are installed, and what additional flags to use when compiling and linking.

Having additional scripts in your path can confuse software installed via Homebrew if the config script overrides a system or Homebrew provided script of the same name. We found the following "config" scripts:

/Library/Frameworks/Python.framework/Versions/2.7/bin/python-config
/Library/Frameworks/Python.framework/Versions/2.7/bin/python2-config
/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7-config

Is there anything I am missing to install OpenCV properly?

Thanks

like image 608
Romain Deterre Avatar asked Nov 13 '22 16:11

Romain Deterre


1 Answers

I would really recommend using pip and a virtualenv for python development. On the Mac this hitchhikers guide is a great read on how to set it up. Using a virtualenv will create an isolated python path and using pip to install things within the virtual env will really help here.

https://python-guide.readthedocs.org/en/latest/starting/install/osx/

like image 175
Matt Alcock Avatar answered Nov 15 '22 04:11

Matt Alcock