As far as I can tell, at least in a docker container, one can definitively
apt-get python 3.
First I ran into a ubuntu container with container:
docker run -it --rm ubuntu:latest bash
then for some reason it needed to update some ubuntu stuff so I did (inside the container):
apt-get update && apt-get install -y build-essential git libjpeg-dev
and then I simply installed python3 and it seems it automatically got python 3.5:
apt-get install python3
apt-get install python3-pip
and to test if pip works lets download something:
pip3 install tensorflow
all seems to work fine for me.
Important Note: it seems that if you already have python 3.4 installed then
apt-get install python3 does not work because it says you already have it. It seems that was one of my problems because I was starting from a docker image from tensorflow (in particular
gcr.io/tensorflow/tensorflow:latest-devel-py3) and something in that image (I assume its that they already have python 3.4 but it might something else) didn't allow me to update my python to get python 3.5.
credit: I discovered this when I asked the following: https://stackoverflow.com/questions/42122826/can-one-use-python-3-5-in-a-docker-container-based-out-of-the-tensorflow-docker
Note: one can also just install Anaconda. For a docker example one can do:
docker pull continuumio/anaconda3
docker run -i -t continuumio/anaconda3 /bin/bash
from their official website: https://hub.docker.com/r/continuumio/anaconda3/
This solution installs python 3.6 but I am sure if you look into it there you can get python 3.5 if thats what you want.
Note: you should probably be using a virtual environment like virtual env or conda/anaconda anyway unless your using docker anyway. Just wanted to remind people.