My builds require python3 and they worked fine yesterday but are failing today, my guess its caused by the switch to Ubuntu 14.04 but obviously could be something else. My previously working build is build 319 where all was well and then it broke in build 320 when running:
pyenv global 3.5.1
I tried various thing and it appears the problem has something to do with the /opt/circleci/.pyenv setup.
ubuntu@box974:~$ which python3 /opt/circleci/.pyenv/shims/python3
It seems the issue is our use of pyenv global to set the python version.
You can read more details in the github issue, but to workaround this, you need to delete .pyenv-version file manually before CircleCI changes python version like this.
There are a few options to fix this permanently and I need to think a bit to decide which path we want to go. Please use the workaround until we fix the issue.
I’ve verified the latest image works, see build 36. To have all three versions of python available I added “pyenv global 2.7.11 3.5.11”: Here is my circle.yml file:
# Circle.yml for testing python3 with Ubuntu 14.04
machine:
pre:
- cat /etc/*release
- pyenv global 2.7.11 3.5.1
test:
pre:
- which python
- v=$(python --version 2>& 1); if [ "$v" == "Python 2.7.11" ]; then echo "$v OK"; else ! echo "$v ERR"; fi
- which python2
- v=$(python2 --version 2>& 1); if [ "$v" == "Python 2.7.11" ]; then echo "$v OK"; else ! echo "$v ERR"; fi
- which python3
- v=$(python3 --version 2>& 1); if [ "$v" == "Python 3.5.1" ]; then echo "$v OK"; else ! echo "$v ERR"; fi
override:
- python3 -c 'print("OK")'