Multiple versions of python

python

Solution

You can use specific version of Python with `virtualenv` like this -

virtualenv -p /usr/bin/python2 <path/to/new/virtualenv/>

This way the virtualenv would use Python 2.x version installed on your system.

PS: DON'T alter the symlinks between Python 2 and 3 manually. Might break your system.

Problem

I have both python versions installed on my linux: ``` [/usr/bin] ls -la | grep python python -> python3 python-config -> python3-config python2 python3 python2-config python3-config ``` I need to launch program which use a python to do some work. I cannot change this program and I don't know how it works, but I want it use python2. As I see I can do it if I change python and python-config links. Is there any better way to do it ? I have not found how to use different versions of python with virtualenv. May be there is something like rvm in ruby ?

Original source

Related problems