How to make Python 2.7 and Python 3.1 coexist on windows 7?
Question: I have a Python 3.1 installed on my desktop but now I need to have Python 2.7
to run CQL. I installed both versions Python on my box, type 'Python', the 3.1
version was invoked. but when I tried to use 2.7 version by specified the path
of the executable of 2.7, the 3.1 was invoked again, with some errors, as
listed below:

    
    
    C:\Python27>.\python.exe
    Traceback (most recent call last):
      File "C:\Python31\lib\site.py", line 56, in <module>
        import os
      File "C:\Python31\lib\os.py", line 380, in <module>
        from _abcoll import MutableMapping  # Can't use collections (bootstrap)
      File "C:\Python31\lib\_abcoll.py", line 54
        class Hashable(metaclass=ABCMeta):
                            ^
    SyntaxError: invalid syntax
    

what should/could I do to make both Python version work for me?


Answer: Either use [cygwin](http://www.cygwin.com/) to have a nice bash environment
that makes it easy to launch python scripts with specific interpreters, or,
use [virtualenv](http://pypi.python.org/pypi/virtualenv) to create
environments based on specific interps:

    
    
    > mkdir project
    > cd project
    > C:\Python27\Scripts\virtualenv.exe -p C:\Python32\python.exe .
    > Scripts\activate
    

At this point, your env has been set to this project, and typing `python` will
start python3.2  
You would type `deactivate` to revert back to normal env. With this approach,
you can either set this up on a per project basis to manage version
dependencies between python projects, or you can make this more global for
each python version in general. Up to you.

In *nix based systems we have the luxury of the "shebang" line at the top of
the script to tell it which interpreter to use. Windows only has file
extension associations via the GUI, and you have to be explicit in the command
line in form of `python <script.py>`

