These instructions show how to install pip and virtualevn on a Mac running Snow Leopard 10.6.8 and using Python 2.7. I used this to install Django 1.3.1 (installation instructions included).
Installing pip
(skip if you have pip installed)
First make sure you have either setuptools or distribute installed. Please consult your operating system’s package manager or install it manually:
curl http://python-distribute.org/distribute_setup.py | python |
Now install pip:
sudo curl https://raw.github.com/pypa/pip/master/contrib/get-pip.py | python |
Install virtualenv
(skip if you have virtualenv already)
Install virtualenv:
pip install virtualenv |
Install Django using pip and virtualenv
Create a directory for a new django project:
mkdir djangoproject cd djangoproject |
Create a virtual environment in a subdirectory (I'm using name "venv"):
virtualenv venv --no-site-packages |
Activate the virtual environment
cd venv source bin/activate which python |
Install django in the virtual environment using pip:
pip install django |
That's it. You can test the installation (if no errors django was installed):
$ python >>> import django >>> |
Now continue with the tutorial on the Django site (version 1.3): https://docs.djangoproject.com/en/1.3/intro/tutorial01/
with
sudo curl https://raw.github.com/pypa/pip/master/contrib/get-pip.py | python
error: could not create ‘/Library/Python/2.7/site-packages/pip’: Permission denied
a better option is change to root.
Hi Juan Pablo
I’m curious. What OS are you running?
I got the same error trying to install pip. I’m on OSX Lion 10.7.2 …
Ah. Needed to have distribute installed.
“Prior to installing pip make sure you have either setuptools or distribute installed. Please consult your operating system’s package manager or install it manually:”
http://www.pip-installer.org/en/latest/installing.html
In the first two command lines, you need `sudo python`, not `sudo curl`.