Monday, October 7, 2024
HomeTutorialsPythonHow to Install Python 3 on CentOS

How to Install Python 3 on CentOS

Learn how to install Python 3.6.3 on CentOS step-by-step. Python is a versatile, high-level programming language known for its simplicity and efficiency. Follow our guide to install Python 3 on CentOS and start coding with Python’s latest features today!

Introduction

Python is a powerful, high-level, general-purpose programming language developed by Guido Van Rossum in 1991. Known for its simplicity and readability, Python allows developers to write efficient code with fewer lines. While CentOS typically comes with Python 2.7 pre-installed, we can also install newer versions like Python 3.5 and 3.6. This tutorial focuses on installing Python 3.6.3 on CentOS.

Prerequisites

  • CentOS operating system
  • Administrator access via terminal
  • Yum package manager configured on the system

Installation Steps

1. Install IUS Community Repository

To install Python 3.6 on CentOS, first, we need to set up the IUS community repository, which provides additional packages for Enterprise Linux. Run the following command to install the IUS repository:

bashCopy code$ sudo yum -y install https://centos7.iuscommunity.org/ius-release.rpm

2. Install Python 3.6

Once the IUS repository is installed, proceed to install Python 3.6 with the following command:

bashCopy code$ sudo yum install python36u

3. Verify Python Installation

To ensure Python 3.6 is correctly installed, type the following command in your terminal:

bashCopy code$ python3.6 -V

This command will display the installed Python version (e.g., Python 3.6.4).

4. Working with Python in Script Mode

To interactively work with Python 3.6, enter the Python shell by typing:

bashCopy code$ python3.6

This opens the Python interactive shell where you can execute Python statements.

Since Python 2 is the default version on CentOS, use python3.6 explicitly to access the Python 3 shell.

Conclusion

Congratulations! You’ve successfully installed Python 3.6.3 on CentOS. You’re now ready to start coding with Python 3 and leverage its powerful features.

Installation on Mac

To install Python 3 on macOS, visit this tutorial and follow the provided instructions.

Installation on CentOS

To install Python 3 on CentOS, please refer to the detailed tutorial available at How to Install Python on CentOS. Follow the provided instructions to complete the installation.

Installation on Ubuntu

To install Python 3 on Ubuntu, please refer to the detailed tutorial available at How to Install Python in Ubuntu. Follow the provided instructions to complete the installation.

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments