Install python 3.6, 3.7 using yum and source code in linux

Python is the most famous and most used programming language in the market, Python was used in many use cases, for example, machine learning...

Python is the most famous and most used programming language in the market, Python was used in many use cases, for example, machine learning, Artificial intelligence, modern web applications, etc...

In this article, we are going to install the python application on the Linux machine using yum repositories as well as using source code.

Most of the Linux flavor python default installed the version 2.6 or 2.7, below 3 python version going to end of their life, It is no longer supported package. So now we are going to install the python package 3.6 using yum and 3.7 using source code.

Installing python 3.6 Using yum:

Step1: Before installing the python update the dependencies files.

            Command: yum update -y                                                                                                                                                                It will update the Available dependency package of updated versions.

Step2: Install the python package for version 3.6

            Command: yum install -y python36-setuptools python36-devel

Now the python version 3.6 was successfully installed, but if we checked using the command python --version it shows the default python version 2.7.
Command:  python --version

If we check the python3 installed version. Command: python3 --version

Default, if search python version shows 2.7, so need to change into 3.6.

Now give the below command to change the default version to 3.6.

Command : alternatives --set python /usr/bin/python3.6

Once given the above command need check using the below command.

Command: alternatives --display python

We can modify the default python version using the same method.

Change python version on per user basis:
               For user basis to change the python version using an alias.

Open the .bashrc file in the user directory here root directory (~), update the alias functionality.

Add the new alias to change the default executable.

Command : vi .bashrc

Add the line: alias python='/usr/bin/python3.4'

Relogin the source using the command:. ~/.bashrc

Now check the python version itself it shows the version.

Command: Python --version     

Now successfully installed the python version 3.6 in the Linux machine using yum repositories.

Install the python3.7 using Source code:

             Installed the dependency packages for installing the python using source code.

Command: yum install gcc openssl-devel bzip2-devel libffi-devel

Change the directory and download the python3.7 source code. 

Commands: cd /opt


Untar the downloaded file.

Command: sudo tar xzf Python-3.7.9.tgz

Change the directory and compile the sour code.

Commands: cd Python-3.7.9

         sudo ./configure --enable-optimizations

The below command is used to install the second version of python packages.

         sudo make altinstall

Once compiled and installation completed without any errors we can check the python version using the below command.

Command: Python --version

Installing the pip3:
                 Pip and pip3 both are used to install the python packages in the machine, pip3 only supported the python3 version packages so now going to install the pip3 and installed a quick fix server on it for demo purposes.

Download the python script to install the pip

Command:  curl -o

Run the downloaded the python file

command: python

Now installed the pip :

command: easy_install-3.6 pip

Once the pip3 is installed we can install the python modules on it.

Now we are going to install the quick fix using the pip3

Command: pip3 install quickfix

Finally, we have installed python 3.6, and 3.7 using the yum and source code. Installed the pip3 tested to Installed the python module on it. 

------------------------------------------!!!Happy Learning With Techiev!!!! ---------------------------------------



Techie View: Install python 3.6, 3.7 using yum and source code in linux
Install python 3.6, 3.7 using yum and source code in linux
Techie View
Loaded All Posts Not found any posts VIEW ALL View Full Article Reply Cancel reply Delete By Home PAGES POSTS View All RECOMMENDED FOR YOU LABEL ARCHIVE SEARCH ALL POSTS Not found any post match with your request Back Home Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sun Mon Tue Wed Thu Fri Sat January February March April May June July August September October November December Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec just now 1 minute ago $$1$$ minutes ago 1 hour ago $$1$$ hours ago Yesterday $$1$$ days ago $$1$$ weeks ago more than 5 weeks ago Followers Follow THIS PREMIUM CONTENT IS LOCKED STEP 1: Share to a social network STEP 2: Click the link on your social network Copy All Code Select All Code All codes were copied to your clipboard Can not copy the codes / texts, please press [CTRL]+[C] (or CMD+C with Mac) to copy