Upgrade Python 2.7 to 3.6 and installing pip on CentOS 7 Rumi, April 2, 2021 Installing Development Tools Development tools are required for building Python modules. To install the necessary tools and libraries type: sudo yum groupinstall 'Development Tools' Enable Software Collections (SCL) Software Collections , also known as SCL is a community project that allows you to build, install, and use multiple versions of software on the same system, without affecting system default packages. By enabling SCL you will gain access to the newer versions of programming languages and services which are not available in the core repositories. CentOS 7 ships with Python 2.7.5 which is a critical part of the CentOS base system. SCL allows you to install newer versions of python 3.x alongside the default python v2.7.5 so that system tools such as yum will continue to work properly. To enable SCL, you need to install the CentOS SCL release file. It is part of the CentOS extras repository and can be installed by running the following command: sudo yum install centos-release-scl Installing Python 3.6 on CentOS 7 Now we will install Python 3.6, which is the latest version available at the time of writing. To do so type the following command on your CentOS 7 terminal: sudo yum install rh-python36 Using Python 3 Once the package rh-python36 is installed, check the Python version by typing: python --version Python 2.7.5 You will notice that Python 2.7 is the default Python version in your current shell. To access Python 3.6 you need to launch a new shell instance using the Software Collection scl tool: scl enable rh-python36 bash What the command above does is calling the script /opt/rh/rh-python36/enable, which changes the shell environment variables. If you check the Python version again, you’ll notice that Python 3.6 is the default version in your current shell now. python --version Python 3.6.3 It is important to point out that Python 3.6 is set as the default Python version only in this shell session. If you exit the session or open a new session from another terminal Python 2.7 will be the default Python version. Install pip Now let’s install python-pip and any required packages: yum -y install python-pip Src: https://linuxize.com/post/how-to-install-python-3-on-centos-7/ https://www.liquidweb.com/kb/how-to-install-pip-on-centos-7/ Related Administrations Configurations (Linux) CentOS 7CnetOSPIPPythonPython 3.6
Add User to Sudoers on CentOS March 21, 2023March 21, 2023 You can do this in 2 methods- however, IMHO method-2 usually works great for me. Method-1 Step 1: Verify the Wheel Group is Enabled Your CentOS 7 installation may or may not have the wheel group enabled. Open the configuration file by entering the command: visudo Scroll through the configuration… Read More
Install PHP 7.3, 7.2, 7.1 on CentOS/RHEL 6.10 August 24, 2019 Configure Yum Repository First of all, you need to enable Remi and EPEL yum repositories on your system. Use the following command to install EPEL repository on your CentOS and Red Hat 7/6 systems Use this command to install epel-release yum repository yum install epel-release and now execute one of… Read More
The safest way to clean up /boot partition in Debian or Ubuntu December 7, 2016 First check your kernel version, so you won’t delete the in-use kernel image, running: uname -r Now run this command for a list of installed kernels: dpkg –list ‘linux-image*’ and delete the kernels you don’t want/need anymore by running this: sudo apt-get remove linux-image-VERSION Replace VERSION with the version of… Read More
As you’re upgrading it’s pointless to keep the old version too, unless there is a necessity of having some backward compatibility of any other app using the older version Reply