Python site-packages

Dan Ports dports at macports.org
Tue Jul 3 02:05:06 PDT 2012


While working on a port that installs Python bindings, I was surprised
to discover that $prefix/lib/python2.7/site-packages wasn't in
python27's package search path. (The correct path, apparently, is
$frameworks_dir/Python/Versions/2.7/lib/site-packages.)

I was surprised by this because, in addition to being a natural place
to look, it's also the path that automake's AM_PATH_PYTHON detects. So
ports that use automake may install into the wrong place.

Sure enough, I found a few examples of this on my system: libcaca,
xorg-xcb-proto, and git-core had modules installed into
$prefix/lib/python2.7/site-packages. 

I wonder if there are other ports that have this problem, and if we
should do something besides fixing them each individually. (I'm not
sure what that would be -- adding $prefix/lib/python2.7/site-packages
to the search path? replacing it with a symlink to the proper
directory?)

Dan

-- 
Dan R. K. Ports              MIT CSAIL                http://drkp.net/


More information about the macports-dev mailing list