gpt4 book ai didi

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

转载 作者:太空宇宙 更新时间:2023-11-04 04:39:17 26 4
gpt4 key购买 nike

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

我想用python2.7配置django。但现在配置的是python2.6。作为一个新的 Linux 用户,我完全感到困惑。我期待你的帮助,提前致谢

最佳答案

使用 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

关于python - 将 django 从 python2.6 更改为 python2.7,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7036690/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com