# to change to macports python... sudo port select --set python python27 # to change back... sudo port select --set python python27-apple
sudo port install py27-psycopg2 sudo port install py27-mysql
however, for the following items, pip was used with apple python to learn how it works; each of these were available on macports and could easily be installed from there
sudo python ~/Downloads/get-pip.py
sudo pip install psycopg2
failed because it couldn't find pg_configexport PATH=$PATH:/opt/local/lib/postgresql93/bin
sudo pip install psycopg2
export PATH=$PATH:/opt/local/lib/mysql55/bin
sudo pip install MySQL-python
python
(starts an interactive python shell)help('modules')