Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

791
Views
Install specific version of python in Dockerfile on ubuntu

I have this in a Dockerfile:

RUN apt install -y python3-pip

how do I install a specific version of python though? Something like this:

RUN apt install -y python3-pip@python===3.6.7

I am looking for:

Python 3.6.7

over 4 years ago · Santiago Trujillo
3 answers
Answer question

0

If you want to install latest version just use RUN apt-get install python3 but if you want to install specific version of python you should do it manually for example were going to install python3.5.1:

sudo apt-get install libssl-dev openssl
wget https://www.python.org/ftp/python/3.5.1/Python-3.5.1.tgz
tar xzvf Python-3.5.1.tgz
cd Python-3.5.1
./configure
make
sudo make install

After installation completed set installed python as default one.

over 4 years ago · Santiago Trujillo Report

0

If you just want to install a specific version of Python over a simple Ubuntu, then why don't you directly use the official Python image corresponding to your needs ?

You can find all the supported images here : https://hub.docker.com/_/python

over 4 years ago · Santiago Trujillo Report

0

RUN /usr/bin/python3 -m pip install --upgrade pip==3.6.7

RUN /usr/bin/python3 -m pip install -r requirements.txt

This worked for me. Please note if you upgrade pip this way if only works with your python3 in /usr/bin/python3. So, you should install your requirements.txt as shown above.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!