Skip to content

Instantly share code, notes, and snippets.

@john-science
Last active July 11, 2021 22:56
Show Gist options
  • Save john-science/d43102fd64d7bbd406e0f03fb7441bca to your computer and use it in GitHub Desktop.
Save john-science/d43102fd64d7bbd406e0f03fb7441bca to your computer and use it in GitHub Desktop.
Installing Python v3.8 dev on Ubuntu 20.04 via Docker
FROM ubuntu:20.04
RUN apt-get update && \
apt-get install --no-install-recommends -y python3-pip python3.8-dev && \
apt-get install vim && \
apt-get install git
@john-science
Copy link
Author

@iFreilicht and @nanguoyu Okay, this is pretty annoying. How would you guys feel about moving this Dockerfile to Ubuntu 20.04? I just checked and it looks like Python 3.8 is the default install there.

It would solve the issue of Python versions, and I personally want the newer version of Ubuntu. But if you guys want 18.04, I can maybe use the above curl hack.

@nanguoyu
Copy link

nanguoyu commented Jun 6, 2021

Yes, you can move to Ubuntu 20.04. If Ubuntu 18.04 and Python 3.8 are essential to you, you can install Python from source and then use update-alternatives.

See this: https://gist.github.com/nanguoyu/0f67ce488da4b3ca179d3af0c8cdc699

Miniconda maybe also a choice.

RUN wget \
    https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh \
    && mkdir /root/.conda \
    && bash Miniconda3-latest-Linux-x86_64.sh -b \
    && rm -f Miniconda3-latest-Linux-x86_64.sh 
    
RUN pip3 install --upgrade pip &&\
	pip3 install setuptools>=41.0.0

@iFreilicht
Copy link

@theJollySin I'm not using this dockerfile anyway, so I'm fine with you upgrading it :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment