How to use pip to install lxml in different version of python?
Question: In my os, `/usr/bin/python` is python2.6, and `/usr/local/bin/python` is
python2.7. I have installed pip, however, when I use the command:

    
    
    pip install lxml
    

I found I can use lxml in python2.7, but I can't use it in python2.6

    
    
    >>> import lxml
    Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    ImportError: No module named lxml
    

How can I install lxml in python2.6 with pip?


Answer: Each `pip` executable is for one Python version/install, and it can tell you
which. On my system:

    
    
    $ pip --version
    pip 1.1 from /usr/lib/python2.7/site-packages (python 2.7)
    

You may also have symlinks such as `pip-2.7` for a particular version.

In your case, if you don’t have it already, you need first to install pip in
Python 2.6. Depending on you OS it might be better to install it with the
distribution’s packages, or to install it through
[distribute](http://packages.python.org/distribute/) (aka. `easy_install`)

