21

I've recently changed my python setup so that's it's now installed with brew. Previously when using virtualenv and virtualenvwrapper it would default to setting up a new virtualenv using python3 (used for most of my projects). Now unfortunately the default is python2. I can install python3 using:

mkproject -p python3 projectname

however how can i make python3 the default?

Yunti
  • 6,761
  • 12
  • 61
  • 106
  • possible duplicate of [Use different Python version with virtualenv](http://stackoverflow.com/questions/1534210/use-different-python-version-with-virtualenv) – postelrich Sep 09 '15 at 21:23

1 Answers1

32

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

Source: https://virtualenv.pypa.io/en/latest/reference.html#configuration

Joe Young
  • 5,749
  • 3
  • 28
  • 27