将django从python2.6更改为python2.7

时间:2011-08-12 07:06:11

标签: python django linux ubuntu

我是新的Linux(Ubuntu)和Python,我的Ubuntu安装了python2.6.6。我新安装了python 2.7,并再次安装了django。

我想用python2.7配置django。但现在它配置了python2.6。我很困惑,因为一个新的Linux用户。我希望你的所有帮助,提前谢谢

1 个答案:

答案 0 :(得分:4)

使用virtualenvwrapper。要安装:

pip install virtualenvwrapper

然后按照http://www.doughellmann.com/docs/virtualenvwrapper/

中的说明修改.bashrc

使用:

mkvirtualenv ENV_NAME --python=python2.7 --no-site-packages
workon ENV_NAME
pip install whatever packages you need
# or
pip install -r requirement_file.txt

每次你进入你的环境时,python都是2.7