• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

How To Install Python 3 On CentOS 7 Using SCL

by admin

Introduction

Python is an interpreted, high-level, general-purpose programming language. Created by Guido van Rossum and first released in 1991, Python’s design philosophy emphasizes code readability with its notable use of significant whitespace. Its language constructs and object-oriented approach aim to help programmers write clear, logical code for small and large-scale projects. It’s an incredible programming language that is ideal for both beginners and well-versed developers. Some of the most popular websites and applications developed using Python include DropBox, YouTube, Quora, Reddit, Pinterest, and Instagram.

This tutorial will show you how to install the latest version of Python on your CentOS 7 system. The installation will utilize the Software Collections (SCL) and distribution default Python 2.7. We’ll also help you learn some basics and create a virtual environment for Python to streamline its usage.

Enabling Software Collections (SCL)

The first thing when installing Python on CentOS 7 is enabling the Software Collections. The Software Collection is a utility that allows executing an application that is not located in the filesystem root hierarchy but is present in an alternative location.

When the SCLs are enabled they grant you unfettered permissions to use the latest version of services and programming languages that may not be present in the main repositories. Run the command below to install the release files for SCL. The release file is a component of the CentOS additional repository.

# yum install centos-release-scl

Enable Python 3

You should have already enabled Software Collection. It means that you can implement any python 3 version: python3.3, python3.4, python3.5, python3.6. On this tutorial will focus on python3.4. To enable it you need to run:

# yum install rh-python34

After that application will be installed.

Using python3.4

After you successfully install following package you had to activate it with command:

# scl enable rh-python34 bash

The command above will call /opt/rh/rh-python34/enable; a script that changes the variables of a shell environment. Now, if you verify your Python version:

# python3 --version
Python 3.4.0

Conclusion

That’s it! You have successfully installed Python 3.4 on your CentOS system and it should be easy to utilize Python programming language to develop a new application.

Filed Under: CentOS/RHEL, Linux

Some more articles you might also be interested in …

  1. How to create and mount filesystems in Linux
  2. lsb_release Command Examples in Linux
  3. What are the Network Bonding Modes In CentOS / RHEL
  4. fuser Command Examples in Linux
  5. How To Add Standard Linux Users To Manage Print Jobs And Services in CentOS/RHEL
  6. What causes iptables to load every time after a reboot even when it’s completely turned off
  7. Linux OS Service ‘kudzu’
  8. Linux OS Service ‘winbind’
  9. Understanding rsyslog Filter Options
  10. Red Hat Virtualization (RHV) Log Files

You May Also Like

Primary Sidebar

Recent Posts

  • JavaFX ComboBox: Set a value to the combo box
  • Nginx load balancing
  • nginx 504 gateway time-out
  • Images preview with ngx_http_image_filter_module

© 2022 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright