Could not find platform independent libraries <prefix> Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
Question: I'm really new to Python and Django.... What I'm trying to do is:

  1. Install Python 2.7 on Mac OS 10.6.8 

  2. Install pip Install Django 

  3. Install virtualenvwrapper 

  4. Create virtual environment 

  5. Install Django-Cms

I think, I'll be is ok from Install virtualenvwrapper to the Django-Cms
installation because I have already done it, but in the first steps I got some
troubles.

I download `Python 2.z` from python.org the **Python 2.7.3 Mac OS X
64-bit/32-bit x86-64/i386 Installer** (for Mac OS X 10.6 and later [2]),
installed whit the wizard . That create a directory
`/System/Library/Frameworks/Python.framework/Versions` with inside my `2.7`
folder.

My directory `/System/Library/Python` is empty

I'm sure I've Python installed cos:

    
    
    python --version
    Python 2.7.3
    

but when I try `easy_install pip` it gave me:

    
    
    Could not find platform independent libraries <prefix>
    Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
    'import site' failed; use -v for traceback
    Traceback (most recent call last):
      File "/usr/bin/easy_install-2.6", line 7, in <module>
        from pkg_resources import load_entry_point
      File "/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/pkg_resources.py", line 16, in <module>
        import sys, os, zipimport, time, re, imp, new
    ImportError: No module named os**
    

Now no idea of what does mean ...so if somebody could help out from this and
put me on the direction where I can istall my virtualenvwrapper I can take it
from there.

I'm Junior a front end developer never touch back end so pls be specific and
explain me what I need to do as u speak with a child.


Answer: You seem to have things turned around. Virtualenv creates a python environment
that encapsulates a python install. So you want to do the following:

  1. Install python
  2. Create a virtualenv using _that_ version of python (eg. virtualenv --python="path to python in 1" _virt_)
  3. Switch to that virtualenv (workon _virt_)
  4. Now install Django, etc. inside of the virtualenv _virt_

[Here is the recipe](http://www.tlswebsolutions.com/mac-os-x-lion-setting-up-
django-pip-virtualenv-and-homebrew/) I used to get my environment setup and
running.

Are you using [homebrew](http://mxcl.github.com/homebrew/)? I've found that's
the most reliable way to get stuff on the mac.

