python3.2 + virtualenv - env create failed
Question: I've got a py2.7 project which I want to test under py3.2. For this purpose, I
want to use virtualenv. I wanted to create an environment that would run 3.2
version internally:

    
    
    virtualenv 3.2 -p /usr/bin/python3.2
    

but it failed. My default python version is `2.7` (ubuntu default settings).
Here is `virtualenv --version 1.10`. The error output is:

    
    
    Running virtualenv with interpreter /usr/bin/python3.2
    New python executable in 3.2/bin/python3.2
    Also creating executable in 3.2/bin/python
    Installing Setuptools...................................................................................................................................................................................................................................done.
    Installing Pip..............
      Complete output from command /home/tomasz/Develop...on/3.2/bin/python3.2 setup.py install --single-version-externally-managed --record record:
      Traceback (most recent call last):
      File "setup.py", line 5, in <module>
        from setuptools import setup, find_packages
      File "/usr/lib/python2.7/dist-packages/setuptools/__init__.py", line 2, in <module>
        from setuptools.extension import Extension, Library
      File "/usr/lib/python2.7/dist-packages/setuptools/extension.py", line 2, in <module>
        from setuptools.dist import _get_unpatched
      File "/usr/lib/python2.7/dist-packages/setuptools/dist.py", line 103
        except ValueError, e:
                         ^
    SyntaxError: invalid syntax
    ----------------------------------------
    ...Installing Pip...done.
    Traceback (most recent call last):
      File "/usr/local/lib/python2.7/dist-packages/virtualenv.py", line 2308, in <module>
        main()
      File "/usr/local/lib/python2.7/dist-packages/virtualenv.py", line 821, in main
        symlink=options.symlink)
      File "/usr/local/lib/python2.7/dist-packages/virtualenv.py", line 963, in create_environment
        install_sdist('Pip', 'pip-*.tar.gz', py_executable, search_dirs)
      File "/usr/local/lib/python2.7/dist-packages/virtualenv.py", line 932, in install_sdist
        filter_stdout=filter_install_output)
      File "/usr/local/lib/python2.7/dist-packages/virtualenv.py", line 899, in call_subprocess
        % (cmd_desc, proc.returncode))
    OSError: Command /home/tomasz/Develop...on/3.2/bin/python3.2 setup.py install --single-version-externally-managed --record record failed with error code 1
    

I don't know what the hell is this syntax error - where does it come from... I
know there was a change in try...catch statement syntax between 2.x and 3.x,
but should virtualenv throw syntax errors?

I'd be grateful if someone pointed me out if there's something I'm doing wrong
or if there is an installation problem on my machine.


Answer: To create a Python 3.2 virtual environment you should use the virtualenv you
installed for Python 3.2. In your case that would be:

    
    
    /usr/bin/virtualenv-3.2
    

