You should be able to just install the needed python3 packages by adding a
before_install: section of your
before_install: - sudo apt-get update - sudo apt-get install python3
If you want to use the container based infrastructure you can make use of the apt addon:
addons: apt: sources: - deadsnakes # source required so it finds the package definition below packages: - python3.5
Packages that can be used are listed here
In order to use dependencies with c-extensions like psycopg2 or pyYAML it is also necessary to add
Travis uses pyenv to manage its Python, and has both Python 2.7.16 and 3.6.3 installed (at the time of writing).
You can use
pyenv global 3.6 to use Python 3.6.3; you don't need root for this.