Is it this, which people seem to recommend most often:
$ sudo apt-get install python-setuptools
$ sudo easy_install pip
$ sudo pip install virtualenv
Or this, which I got from http://www.pip-installer.org/en/latest/installing.html:
$ curl -O https://github.com/pypa/virtualenv/raw/master/virtualenv.py
$ python virtualenv.py my_new_env
$ . my_new_env/bin/activate
(my_new_env)$ pip install ...
Or something entirely different?
The former method is fine. The only problem I can see is that you might end up with an old version of setuptools (if the apt repository hasn't been kept up-to-date..
I use get-pip and virtualenv-burrito to install all this. Not sure if python-setuptools is required.
To install pip on a mac (osx), the following one liner worked great for me:
Starting from distro packages, you can either use:
which lets you create virtualenvs, or
which lets you install arbitrary packages to your home directory.
If you're used to virtualenv, the first command gives you everything you need (remember, pip is bundled and will be installed in any virtualenv you create).
If you just want to install packages, the second command gives you what you need. Use pip like this:
and put something like
in your
~/.bashrc
.If your distro is ancient and you don't want to use its packages at all (except for Python itself, probably), you can download virtualenv, either as a tarball or as a standalone script:
If your distro is more of the bleeding edge kind, Python3.3 has built-in virtualenv-like abilities:
This runs way faster, but setuptools and pip aren't included.