13 C
Texas
Melhttp://www.osradar.com
Guru Unix /Linux and GNU supporter

Install Python 3.7 on centos 7 and Fedora 27/28

Python is the  one of the best object-oriented programming language with lots of features which do support in development of web applications as well, and   If you are a programmer or Python Developer  you may  always follow the the last releases witch contain last updates and  new features.

i will try to test that on my Centos 7.5  and  python 2.7

Downoad the  last Python tar file from

Step 1 – Requirements

- Advertisement -

One of the top  requirement of Python  is the  GCC compiler on your system.  please login to ur system and Download the  needed requirements  for Python

 #yum install gcc openssl-devel bzip2-devel libffi libffi-devel
Installing:
bzip2-devel x86_64 1.0.6-13.el7 base 218 k
gcc x86_64 4.8.5-28.el7_5.1 updates 16 M
openssl-devel x86_64 1:1.0.2k-12.el7 base 1.5 M
Installing for dependencies:
cpp x86_64 4.8.5-28.el7_5.1 updates 5.9 M
glibc-devel x86_64 2.17-222.el7 base 1.1 M
glibc-headers x86_64 2.17-222.el7 base 678 k
kernel-headers x86_64 3.10.0-862.6.3.el7 updates 7.1 M
keyutils-libs-devel x86_64 1.5.8-3.el7 base 37 k
krb5-devel x86_64 1.15.1-19.el7 updates 269 k
libcom_err-devel x86_64 1.42.9-12.el7_5 updates 31 k
libkadm5 x86_64 1.15.1-19.el7 updates 175 k
libmpc x86_64 1.0.1-3.el7 base 51 k
libselinux-devel x86_64 2.5-12.el7 base 186 k
libsepol-devel x86_64 2.5-8.1.el7 base 77 k
libverto-devel x86_64 0.2.5-4.el7 base 12 k
mpfr x86_64 3.1.1-4.el7 base 203 k
pcre-devel x86_64 8.32-17.el7 base 480 k
zlib-devel x86_64 1.2.7-17.el7 base 50 k

 

Step 2 – Download last python release ” Python 3.7

Download Python using  from python official site using wget .

#cd /root 
#wget https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tgz

Now extract  the downloaded file

#tar xzf Python-3.7.0.tgz

Step 3 – Install Python 3.7

Use below set of commands to compile Python source code on your system using altinstall.

#cd Python-3.7.0

Configure

this  action will prepare your prepare the package for the compilation

 #./configure --enable-optimizations

Compile the Package

 
#make altinstall

--------------------------------------------
--------------------------------------------------------
if test "xupgrade" != "xno" ; then \
case upgrade in \
upgrade) ensurepip="--altinstall --upgrade" ;; \
install|*) ensurepip="--altinstall" ;; \
esac; \
./python -E -m ensurepip \
$ensurepip --root=/ ; \
fi
Looking in links: /tmp/tmpoolx9axs
Collecting setuptools
Collecting pip
Installing collected packages: setuptools, pip
Successfully installed pip-10.0.1 setuptools-39.0.1


make altinstall is  very  important to avoid   replacing the default python binary file /usr/bin/python.

This action will take some minutes  to  create the  package

you can also  remove the  Downloaded tar file if your  like  with command  rm

rm -f /root/Python-3.7.0.tgz

Step 4 – Check Python Version

Check the latest version installed of python. Use command python3.7 instead of just python.

#python3.7 -V

Python 3.7.0

Step 5 – Check if yum package still working

Check if  if  your  original python still working and if  Yum or dnf  package  is not crashed with the new package

#python -V
#yum install telnet

Please  Enjoy , Cheers !!

- Advertisement -
Everything Linux, A.I, IT News, DataOps, Open Source and more delivered right to you.
Subscribe
"The best Linux newsletter on the web"

4 COMMENTS

LEAVE A REPLY

Please enter your comment!
Please enter your name here



Latest article