我最近更改了我的 python 设置,现在它已与 brew 一起安装。以前在使用 virtualenv 和 virtualenvwrapper 时,它会默认使用 python3(用于我的大部分项目)设置一个新的 virtualenv。现在不幸的是默认是python2。我可以使用以下方法安装 python3:
mkproject -p python3 projectname
但是我怎样才能使 python3 成为默认值呢?
最佳答案
To automatically use a custom Python binary instead of the one virtualenv is run with you can also set an environment variable:
$ export VIRTUALENV_PYTHON=/opt/python-3.3/bin/python $ virtualenv ENV
It’s the same as passing the option to virtualenv directly:
$ virtualenv --python=/opt/python-3.3/bin/python ENV
来源:https://virtualenv.pypa.io/en/latest/reference.html#configuration
关于python - 使用 virtualenvwrapper (& virtualenv) 改变默认的 python 版本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32489304/