After I clone the trellis and bedrock repos to the relevant directory and run vagrant up, I receive this error.
ERROR! Trellis does not yet support Python 3.6.4.
Please use Python 2.7.
I’m on macOS High Sierra 10.13.6 and when I run python --version I get back 3.6.4.
Looking at other posts on this board, I notice that people recommend uninstalling python 3 in order to default back to python 2. I use python 3 for work and I would prefer not to uninstall it. Is there a way I can have the relevant trellis/ansible files use python 2 instead of my default python 3?
I installed pyenv, then install python 2 with pyenv and then set the local python version to 2.7 but the installation still failed with the same exact message.
It successfully installs using this method, but when I go the address stipulated by canonical, the local server doesn’t load in my browser. Not sure what the issue is, but at least it apparently installed correctly.
I have seen you were working on making Trellis python3 compatible (branch trellis/python-3-compat).
What is the advancement of that? Would it be useable at beta stage?
For those who need to do something in an old trellis install (and don’t want to deal with updating it), on OS X, Python 2.7 can be installed via Homebrew with:
(NOTE: Scott suggests, here, that provisioning a new server as a good practice, when there have been significant (“breaking”) changes, such as upgrades to php.)
If source /usr/local/bin/virtualenvwrapper.sh script is returning an error:
Usage:
pip <command> [options]
no such option: -m
virtualenvwrapper.sh: There was a problem running the initialization hooks.
If Python could not import the module virtualenvwrapper.hook_loader,
check that virtualenvwrapper has been installed for
VIRTUALENVWRAPPER_PYTHON=/usr/local/bin/pip and that PATH is
set properly.
Fix is to add the following line to /.bashrc (or .bash_profile), before setting the VIRTUALENVWRAPPER_PYTHON variable::
export VIRTUALENVWRAPPER_PYTHON=/usr/local/bin/python # for brew installed python
I’m not sure what the best way to figure out which version of Ansible you need for your version of Trellis is. If it’s too old, Trellis will tell you. I guess you can also look at trellis/plugins/vars/version.py and see what version_requirement is.