How to setup python Interpreter On the Docker

How to setup python Interpreter On the Docker

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.

No alt text provided for this image

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.

No alt text provided for this image

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

No alt text provided for this image

It is being installing.

No alt text provided for this image

Now we can see It was installed successfully.

We have to use the python interpreter.To launch python interpreter run the command

python3

No alt text provided for this image

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.

No alt text provided for this image

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.


要查看或添加评论,请登录

Naga phani的更多文章

社区洞察

其他会员也浏览了