The MacPorts Project is an open-source community initiative to design an easy-to-use system for compiling, installing, and upgrading either command-line, X11 or Aqua based open-source software on the Mac OS X operating system
To check if MacPorts is installed, try to issue the command port search twig. If this command completes without error, then you have MacPorts.
If the above command gives an error, try to issue /opt/local/bin/port search twig. If this command works, then you have MacPorts installed. Run the gtsetup.sh script, and quit and start your terminal programs.
If the command fails, you will have to install MacPorts. To install MacPorts, follow these instructions