Trellis does not yet support Python 3.6.4

ansible

#1

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?


#2

Try a python version manager:


#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.


#4

I tried virtualenv too and it didn’t work.

virtualenv --python=/usr/bin/python2.7 trellisenv
source tresslisenv/bin/activate
vagrant up

Still gives my the python version error.


#5

I got it working with Anaconda.

conda create --name trellisenv python=2.7
source activate trellisenv
conda install ansible=2.5.3
vagrant up

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.


#6

I’ve successfully used virtualenv and virtualendwrapper. I already had Python 3 and 2.7 from homebrew.

pip install virtualenvwrapper
export WORKON_HOME=~/Envs
mkdir -p $WORKON_HOME
source /usr/local/bin/virtualenvwrapper.sh
mkvirtualenv -p /usr/bin/python2.7 p2
pip install ansible==2.5.3.0
vagrant up

So whenever I want Python 2, I use that virtualenv. Otherwise I just use Python 3 without it.


#7

Hi all,

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?

Thanks


#8

bump @swalkinshaw ?

Thanks in advance!