How do I create a virtual environment for a specified version of Python?
NOTE: For Python 3.3+, see The Aelfinn's answer below.
Use the --python
(or short -p
) option when creating a virtualenv instance to specify the Python executable you want to use, e.g.:
virtualenv --python="/usr/bin/python2.6" "/path/to/new/virtualenv/"