Sunday, March 20, 2011

giving up

I've spent the past hour trying again to get the Python 2.7 and OpenCV 2.2 on my Mac to work. The problem is that there isn't a binary installer. You have to build from source. I can't tell if it's something I'm mis-configuring in the makefiles or if it's something I'm missing on the Mac that I'm unfamiliar with.

Lets start with a basic thing: where Python is installed. I found Python 2.5 and 2.6 here:

/System/Library/Frameworks/Python.framework/Versions/2.5
/System/Library/Frameworks/Python.framework/Versions/2.6

I KNEW that Python 2.7 was installed because it tells me what version it is when I start it, so after MUCH searching I found 2.7 here:

/Library/Frameworks/Python.framework/Versions/2.7

Why? Because. That's why. Seriously - I did some searching and basically the Python shipped on Mac systems goes in one place, and the Python in staller from the website puts it in another. Just because.

So that was an issue because I realized this morning I was pointing my makefiles in the wrong direction for where the python headers were. The python module it dumped out still crashes Python, but at least Python doesn't complain about possible wrong version of the module first.

-sigh-

Not knowing where anything goes has been quite the headache the past few days. Not knowing what happens after I type "make" is even more annoying. I unzip the OpenCV package in one place, then I configure the makefiles with CMake. This creates a new directory one step up from my unzipped directory called /usr/lib/... which after I run "make" it dumps more stuff and then I guess compiles from that directory. Where it places the files generated has been an irritating hunt. It took me forever to find them in /usr/local/lib. I'm having to re-learn a lot of Unix stuff. I find it hard to swallow that I have two "user" directories. One that's /Users/Cheydrick and another that's /usr/local/. Oh, even being allowed to SEE the Unix-specific directories was a chore. I'm not complaining (it was a quick Google search away) but still. I don't know if this is true of Unix in general, but it's symbolic link nightmare central here.

Ironically, I've had no problems getting the OpenCV libraries to build in XCode. I'd have figured that to be the more difficult task but the nakedness of C allows me to read the error messages and fix it. It was just a matter of saying ".dylib files are here, bro" and "header files are over here, bro" and everything was happy.

I might have to just be happy getting Python+OpenCV working on the PC and then maybe later take a stab getting it to work on the Ubuntu box.

In the meantime, I'll get back to C on the laptop. I don't know if I'll have time to knock out anything else in Python on the PC.

If OpenCV goes to version 2.3 maybe I'll try again.

EDIT: Because I'm a glutton for punishment I'm going to give it a shot on the Ubuntu netbook. Actually that could be pretty neat...

No comments:

Post a Comment