# How To Install Python 3.7 on CentOS/RHEL 7/6 & Fedora 30-25

**URL:** <https://onehack.st/t/how-to-install-python-3-7-on-centos-rhel-7-6-fedora-30-25/54168>\
**Category:** Tutorials & Methods\
**Tags:** tips-tricks\
**Created:** [August 18, 2019, 7:24pm UTC](https://onehack.st/t/how-to-install-python-3-7-on-centos-rhel-7-6-fedora-30-25/54168 "2019-08-18T19:24:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aina](https://onehack.st/user_avatar/onehack.st/aina/32/167469_2.png) [@Aina](https://onehack.st/u/Aina)\
**Post date:** [August 18, 2019, 7:24pm UTC](https://onehack.st/t/how-to-install-python-3-7-on-centos-rhel-7-6-fedora-30-25/54168/1 "2019-08-18T19:24:52Z")

</div>

**Step 1 – Requirements**

This Python installation required GCC compiler on your system. Login to your server using ssh or shell access. Now, use the following command to install prerequisites for Python before installing it.

Code:

```auto
yum install gcc openssl-devel bzip2-devel libffi-devel

```

**Step 2 – Download Python 3.7**  
Download Python using the following command from the Python official site. You can also download the latest version in place of specified below.

Code:

```auto
cd /usr/src
wget https://www.python.org/ftp/python/3.7.3/Python-3.7.3.tgz

```

Now extract the downloaded package.

Code:

```auto
tar xzf Python-3.7.3.tgz

```

**Step 3 – Install Python 3.7**  
Use below set of commands to compile Python source code on your system using altinstall.

Code:

```auto
cd Python-3.7.3
./configure --enable-optimizations
make altinstall

```

**make altinstall** is used to prevent replacing the default python binary file **/usr/bin/python**.

Now remove downloaded source archive file from your system

Code:

```auto
rm /usr/src/Python-3.7.3.tgz

```

**Step 4 – Check Python Version**  
Check the latest version installed of python. Use command python3.7 instead of just python.

Code:

```auto
python3.7 -V

Python 3.7.3

```

## ENJOY & HAPPY LEARNING! 🤗
