Monday 2nd Sep 2013

Since starting to use OS X I’ve hit many obstacles in getting my Python environment set up correctly. I’ve been setting up a couple of libraries and had read various posts from people recommending macports over homebrew as a package manager for OS X.

I set up macports and began installing python2.6 (as this is the version shipped with Maya). Then I attempted to install some Python libraries such as the pyexiv2 library, this took nearly two days of faffing about until I discovered that my version of boost_python was named boost_python_mt as it’s multithreaded. I followed this guide to help me fix the Sconscript file.

I had another (different) set of issues installing the Flickrapi for Python. This didn’t seem be available via macports and so I turned to easy_install. Then followed another day of hair pulling and link chasing on the web to find an answer. I firstly discovered that I needed to manually create a site-packages folder in my macports python 2.6 folder:


Secondly that even if this folder was featured in my $PYTHONPATH variable. This was erased when I used the sudo command with easy_install (needed as easy_install didn’t have access privileges to the new site-packages folder). This Stack Exchange answer helped me fix this issue by adding the following to my suders file.

Defaults env_keep += "PYTHONPATH"

Phew !

The flickrapi worked fine in a command line Python but I couldn’t get it working in Eclipse unless I explicitly included it in the project’s External Libraries properties. But at this point I’d lost the will to live and just wanted to get to play with the library. If I find a fix for this I’ll update the post.

Anyway I’ve posted this in case it helps someone else in the future. Plus hopefully it’ll help me remember all these hoops next time I need to do this.