[英]Set up a python virtualenv with a specific version of Python
I am trying to get started with Google App Engine. 我正在尝试开始使用Google App Engine。 I have python 2.6 installed in my virtual environment which I wanted to use.
我在要使用的虚拟环境中安装了python 2.6。 But Google App Engine supports python2.5.
但是Google App Engine支持python2.5。 So I want to set up another python virtual environment with python 2.5.
所以我想用python 2.5设置另一个python虚拟环境。
Can you help me how to do exactly that? 您能帮我该怎么做吗?
Virtualenv lets you specify a python
binary to use instead of the default. Virtualenv允许您指定要使用的
python
二进制文件而不是默认文件。 On your machine, python
probably maps to /usr/bin/python
, which will be a symlink to /usr/bin/python2.6
. 在您的机器上,
python
可能映射到/usr/bin/python
,这将是/usr/bin/python2.6
的符号链接。 If you've got Python 2.5 installed, it will be /usr/bin/python2.5
如果您已安装Python 2.5,则它将为
/usr/bin/python2.5
You can create a virtualenv called envname
with virtualenv -p /usr/bin/python2.5 envname
您可以使用
virtualenv -p /usr/bin/python2.5 envname
创建一个名为envname
的virtualenv -p /usr/bin/python2.5 envname
Do you specifically need a virtual environment? 您是否特别需要虚拟环境?
Why not just Install Python 2.5 along side your existing 2.6 and just use 2.5 for your GAE development. 为什么不将Python 2.5与现有2.6一起安装,而仅将2.5用于GAE开发。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.