Just use the --python
(or short -p
) option when creating your virtualenv instance to specify the Python executable you want to use, eg:
(在创建virtualenv实例时,只需使用--python
(或short -p
)选项即可指定要使用的Python可执行文件,例如:)
virtualenv --python=/usr/bin/python2.6 <path/to/new/virtualenv/>
NB For Python 3.3 or later, refer to The Aelfinn's answer below.
(注意:对于Python 3.3或更高版本,请参阅下面的Aelfinn 答案 。)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…