virtualenv and Django on a Mac

Information on this page is quite outdated. In 2019 use pyenv or pipenv.


I work on OS X Lion. Up until recently, I just used “pip install stuff” and it all worked fine. I could even make Django projects use different versions of Django just by coping another version in project root.

I didn’t like it. it was all in one place, cluttered and though I didn’t run into problems, I had a feeling there is one just around the corner.

Enter virtualenv!

So, to cut the story short, here are a link worth checking:
I followed steps 1-4 almost to the letter, and I can verify it works juist fine šŸ™‚

I havent tried theĀ Qt Console, but I recommend IPython and (required) readline. The two together make auto-completing in Django shell a pleasure to use. IPython is pip-installable, and readline should be easy-installed, not pip-installed (something about whichĀ packagesĀ load first).

Also, the “Dynamic object information” feature is awsome:




Update to Mountain Lion broke the virtualenvs, but the recovery was easy, as described here:

basically, this:

  1. Installed theĀ XCode 4.4 Command Line Tools.
  2. Re-installed pip: sudo easy_install pip
  3. Re-installed virtualenv and virtualenvwrapper: sudo pip install virtualenv virtualenvwrapper