This post will quickly help you install Python2.7, pip, and virtualenv.
Assuming you downloaded the tar to your
~/Downloads directory, we
do the following:
$ cd ~/Downloads $ tar zxf Python-2.7.tgz $ cd Python-2.7 $ ./configure
At this point, if you're on Ubuntu and see an error along the lines of
Python.h not found, then you need to install the python-dev package.
$ sudo apt-get install python-dev
Now we use
make to finish the installation
$ make # This make take a few minutes $ sudo make install
If you come across any errors during the process, copying and pasting the error message into Google is almost guaranteed to help.
Verify the installation has succeded by running
$ python --version
The response should be "Python 2.7.3"
Installing pip and virtualenv
Assuming you downloaded setuptools-0.6c11-py2.7.egg to your
directory, execute the following
$ cd ~/Downloads $ sudo bash setuptools-0.6c11-py2.7.egg
We use the
which command to verify setuptools correctly installed the
which simply tells you where an executable is
located on the filesystem. If you get an empty response back, that means the
program is either not installed or not in your $PATH.
$ which easy_install
The response should be non-empty. My response was
Now we use
easy_install to install pip
$ sudo easy_install pip
We can once again verify pip's installation with the
$ which pip
Finally, we can install virtualenv with
$ sudo pip install virtualenv
You no longer have to worry about using
easy_install, which should be
avoided since you cannot uninstall packages using