Python package management
Python ships with easy_install but that is limited so people use pip:
sudo easy_install pip
Whilst pip is better than easy_install it still installs dependencies globally by default (unlike npm, sbt, mvn etc.). So, everyone uses virtualenv:
sudo pip install virtualenv
Using virtualenv is a little involved:
mkdir ~/my-python-project
cd ~/my-python-project
virtualenv env
source env/bin/activate # Do this for every session
In python, the standard is to create a requirements.txt to specify dependencies:
echo "requests==2.9.1" > requirements.txt
pip install -r requirements.txt
Assuming one wants to use python 3 then it should be as simple as:
virtualenv -p python3.5 env
# Assumes: sudo port install python35
Note that env can be something more descriptive. Perhaps the (short) project name.
To deactivate the virtual environment just run:
deactivate