Python 3.6 and 3.7: A Dual Installation Guide on Linux Using Yum and Source Code

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 needs 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 (~), and 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 Python version 3.6 in the Linux machine using yum repositories.

Install the python3.7 using the 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

         wget https://www.python.org/ftp/python/3.7.9/Python-3.7.9.tgz

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 https://bootstrap.pypa.io/get-pip.py -o get-pip.py

Run the downloaded python file

command: python get-pip.py

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 Install the python module on it. 


----------------------------------------!!!! Happy Learning with Techiev !!!!!!!!----------------------------------

-------------------------Subscribe our Youtube Channel by clicking the below link---------------------- ----------------------------!!https://www.youtube.com/@techieview729!!---------------------



 

Name

AWS,19,CNCF,8,Devops,37,linux,11,
ltr
item
Techie View: Python 3.6 and 3.7: A Dual Installation Guide on Linux Using Yum and Source Code
Python 3.6 and 3.7: A Dual Installation Guide on Linux Using Yum and Source Code
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLDolXSUy4udHRXV7rQK07i_ibmCZ6ckYx5qiBmVvZmDHR0ZB6tXBER5Dv2SgI8BbygvbVfiU7o_9FDX5MhYfYZj47uhkLw3E419lnczcLW2cdSIy4PR_5dB2LwEDIDqexV4vSDbjyS9CY/s320/python7.jpeg
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLDolXSUy4udHRXV7rQK07i_ibmCZ6ckYx5qiBmVvZmDHR0ZB6tXBER5Dv2SgI8BbygvbVfiU7o_9FDX5MhYfYZj47uhkLw3E419lnczcLW2cdSIy4PR_5dB2LwEDIDqexV4vSDbjyS9CY/s72-c/python7.jpeg
Techie View
https://www.techiev.com/2020/12/install-python-36-37-using-yum-and.html
https://www.techiev.com/
https://www.techiev.com/
https://www.techiev.com/2020/12/install-python-36-37-using-yum-and.html
true
7013663511659419322
UTF-8
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