Eu acho que eu descobri a resposta para minha pergunta.
Eu editei meu arquivo ~ / .bash_profile para incluir
export PYTHONPATH=
e depois adicionei todos os caminhos existentes em sys.path
:
export PYTHONPATH=/Library/Frameworks/SQLite3.framework/Versions/3/Python:/Library/Python/2.6/site-packages/numpy-override:/Library/Frameworks/GDAL.framework/Versions/1.7/Python/site-packages:/Library/Frameworks/cairo.framework/Versions/1/Python:/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python26.zip:/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6:/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/plat-darwin:/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/plat-mac:/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/plat-mac/lib-scriptpackages:/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python:/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-tk:/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-old:/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-dynload:/Library/Python/2.6/site-packages:/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/PyObjC:/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/wx-2.8-mac-unicode:/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/:/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages:
e depois eu adicionei os caminhos aos diretórios onde o MacPorts instalou coisas:
/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/:/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages:
agora, quando imprimo sys.path, os caminhos para os diretórios de instalação do MacPorts estão incluídos:
/Library/Frameworks/SQLite3.framework/Versions/3/Python
/Library/Python/2.6/site-packages/numpy-override
/Library/Frameworks/GDAL.framework/Versions/1.7/Python/site-packages
/Library/Frameworks/cairo.framework/Versions/1/Python
/Library/Frameworks/SQLite3.framework/Versions/3/Python
/Library/Python/2.6/site-packages/numpy-override
/Library/Frameworks/GDAL.framework/Versions/1.7/Python/site-packages
/Library/Frameworks/cairo.framework/Versions/1/Python
/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python26.zip
/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6
/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/plat-darwin
/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/plat-mac
/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/plat-mac/lib-scriptpackages
/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python
/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-tk
/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-old
/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-dynload
/Library/Python/2.6/site-packages
/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/PyObjC
/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/wx-2.8-mac-unicode
/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6
/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages
Agora
>>> import PIL
e
>>> import psycopg2
funcione bem.