22

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?

1

1 Answer 1

33

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

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.