How to setup python Interpreter On the Docker
Naga phani
?? Computer Science Engineer || ???? Software Engineer ||?? Cloud & DevOps Enthusiast || ?? AI & Machine Learning Practitioner
To Install any Software we need OS.In the Docker world Container is the one OS which takes less computing power.
So firstly we need to launch the container to launch any conatiner we need the image from that base of the image we create and run the container.
Here in mycase I had already one Image that is Centos from this a I am launching the container.
To run the container use the command
docker run -it --name pyint centos
Here -it stands for go to the container and gives the terminal of tht container.
Now we can see we have landed to the container.In this we have to install python for python interpreter.
To install python3 in the docker container use the command
yum install python3
It is being installing.
Now we can see It was installed successfully.
We have to use the python interpreter.To launch python interpreter run the command
python3
We can see we had successfully launched the python Interpreter and run so code in that.
Now we have create a python code file and run it.
Her I am using a python code for adding two numbers and run it successfully with the command python3 file_name.py
conclusion:successfully launching the python Interpreter on the docker container and run some python code in it.