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?
By default, that will be the version of python that is used for any new environment you create. However, you can specify any version of python installed on your computer to use inside a new environment with the -p flag : $ virtualenv -p python3. 2 my_env Running virtualenv with interpreter /usr/local/bin/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
Source: https://virtualenv.pypa.io/en/latest/reference.html#configuration
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With