Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save epicserve/3180261 to your computer and use it in GitHub Desktop.
Save epicserve/3180261 to your computer and use it in GitHub Desktop.
How to fix your python virtualenvs after installing OS X 10.8 Mountian Lion

Ran the following so virtualenvwrapper worked again:

$ sudo curl https://raw.github.com/pypa/pip/master/contrib/get-pip.py | sudo python
$ sudo pip install virtualenvwrapper

After I tried using django-admin.py runserver in a virtualenv I got the following error.

IOError: [Errno 2] No such file or directory: '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/__init__.py'

Running the following fixed that error:

$ cd /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/
$ sudo touch __init__.py

In order to get my dev version for django-environment to work I had to do the following:

$ cd /Library/Python/2.7/site-packages/virtualenvwrapper
$ sudo ln -s ~/Code/django/django-environment/virtualenvwrapper/django_env.py
@kennethreitz
Copy link

@epicserve
Copy link
Author

@maltebeckmann, I'm using Postgres installed via Homebrew and have been for years. I'm happy with it. I haven't tried the new Postgres.app made by Heroku. I just recently switched to Python 2.7.3 installed via Homebrew and it seems a little faster than the system Python. The nice thing is that I won't have to worry about upgrading the OS breaking my python environment now. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment