We’re going to go through a few steps to get a nice development environment for working with Python (and Django) on Ubuntu.
We’re going to be using pip to install and manage packages, but first we need easy_install, which comes with the setuptools package. To install setuptools (and easy_install), run the following:
To ensure this has worked, run the following command which should return the version number of easy_install.
To install pip run:
Again to verify that pip was installed correctly, check its version.
Next we’ll see pip to install virtualenv and virtuenvwrapper:
Next, we’re going to set virtualenv to store our virtual environments in our home folder to keep things tidy:
Setup bash to work with virtualenv (this should be the path to your virtualenvwrapper.sh):
Finally, one more recommended step. We’re creating an alias which will cause mkvirtualenv to not use site packages and to use distribute (instead of setuptools).
To reload our new bash settings without restarting our shell, run the following (or just open a new terminal window), otherwise you will get ‘command not found’ errors when running virtualenv:
That’s it! You can now begin creating and using virtual environments in Part 2.