Issues installing Python3 and Pip in ubuntu in Docker

Issues installing Python3 and Pip in ubuntu in Docker

text

1) Download the Ubuntu image

docker pull ubuntu

2) View the image

docker images

3) Run the container

docker run -itd --name ubuntu-test ubuntu

4) Enter the container

sudo docker exec -it ubuntu-test /bin/bash

5) Update source

apt-get update

If you don't do this, you may run into the following problems:

Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package Python

Just run it once

6) Install python3

apt-get install python3

7) Install pip3

 apt-get install python3-pip

8) Testing

pip3 install numpy
Collecting numpy
 Downloading numpy-1.20.1-cp38-cp38-manylinux2010_x86_64.whl (15.4 MB)
   |███████████████████████████████████| 15.4 MB 1.9 MB/s
Installing collected packages: numpy
Successfully installed numpy-1.20.1

This is the end of this article about installing Python3 and Pip in Ubuntu in Docker. For more information about installing Python3 and Pip in Docker Ubuntu, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • Detailed explanation of installing Python 3.7 and pip3 in Ubuntu 16.04 and switching to the default version
  • How to install pip for python and python3 in ubuntu17.4
  • Python3 installation and pip source change and usage tutorial under win10 system
  • Tutorial on upgrading and installing python 3.8 and configuring pip and yum under Linux
  • Pip3 installation error in python3, no solution for SSL found
  • Detailed steps to install pip tool in Python3

<<:  Master the commonly used HTML tags for quoting content in web pages

>>:  How to uninstall MySQL cleanly (tested and effective)

Recommend

Detailed explanation of lazy loading and preloading of webpack

Table of contents Normal loading Lazy Loading Pre...

Example code of the spread operator and its application in JavaScript

The spread operator allows an expression to be ex...

In-depth understanding of MySQL global locks and table locks

Preface According to the scope of locking, locks ...

Graphic tutorial on installing tomcat8 on centos7.X Linux system

1. Create the tomcat installation path mkdir /usr...

MySQL table type storage engine selection

Table of contents 1. View the storage engine of t...

What to do if you forget your password in MySQL 5.7.17

1. Add skip-grant-tables to the my.ini file and r...

When to use table and when to use CSS (experience sharing)

The main text page of TW used to have a width of 8...

Measured image HTTP request

Please open the test page in a mainstream browser...

Detailed explanation of how to create an array in JavaScript

Table of contents Creating Arrays in JavaScript U...

How to set a fixed IP in Linux (tested and effective)

First, open the virtual machine Open xshell5 to c...

Historical Linux image processing and repair solutions

The ECS cloud server created by the historical Li...

Implementation of MySQL asc and desc data sorting

Data sorting asc, desc 1. Single field sorting or...

Vue component to realize carousel animation

This article example shares the specific code of ...