Setting up Python Interpreter and running Python Code on Docker Container

Rutujakonde
Nov 11, 2020

--

Docker container does not have the python program by default. We need to first install it . The installation part is very simple as yum is already configured .

Generally, the latest version of any OS like RHEL 8 or centos 8 support python version 3 software. So let’s see python3 command will work in the docker container or not

python is not installed in the container. So we can install it by using yum or dnf command

Here, both the software name and module name are same i.e python3. SO now install python3 by using yum

And now all is set. We can use python3 command to use python REPL

Also, we can run python script by the command

python3 <file_name.py>

--

--

No responses yet