Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

uqarni

macrumors newbie
Original poster
Sep 20, 2012
1
0
Hello there,

Total noob here trying to get OpenCV working on Python through Homebrew.
Installed software:

OS 10.7.4
Xcode 4.4.1
-Command Line Tools
HomeBrew
-Python
-GFortran
-OpenCV

1. write this on first line of .bash_profile

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

2. open IDLE located at /usr/local/Cellar/python/2.7.3

>>> import cv

Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
import cv
File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/cv.py", line 1, in <module>
ImportError: No module named cv2.cv

Go to Terminal to check PATH and PYTHONPATH

myname-MacBook-Pro:~ myname$ set
#edited out unnecessary lines
PATH=/opt/local/bin:/opt/local/sbin:/opt/local/bin:/opt/local/sbin:/opt/local/bin:/opt/local/sbin:/opt/local/bin:/opt/local/sbin:/opt/local/bin:/opt/local/sbin:/opt/local/bin:/opt/local/sbin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin
PYTHONPATH=/usr/local/lib/python2.7/site-packages:

1) What does my PATH need to be? I know its comically out of whack from repeated attempts.
2) Why isnt IDLE using this PYTHONPATH?


Thank you very much for any help you can send my way.
 
Last edited:
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.